[pytest-dev] on progressing to fix up marks

Ronny Pfannschmidt rpfannsc at redhat.com
Thu Sep 8 07:51:30 EDT 2016

hi everyone

i began seeing a path towards cleaning up marks without breaking everything

i started with https://github.com/pytest-dev/pytest/pull/1921
which introduces a correct mechanism for using marked values in parameter

and https://github.com/pytest-dev/pytest/pull/1923
which introduces an actual representation for single marks (before marks
existed only as decorators or mashed into a markinfo (which is a mark and a
list of marks)

after following up with those pull requests, i want to break some apis that
introduce bugs and mistakes

the first part of that is putting lists of self-owned mark objects onto
collection nodes (and only the mark objects) and viewing the markers of a
test node as the union of those owned markers

at the same pace i would completely deprecate the named mark objects that
are smeared onto functions, so we can remove them for pytest 4.0 or 5.0

i would also leave the breaking behaviour of those markinfo objects intact
the canonical source for a union view of the marks should always be the
test item, not the function object being marked

node.get_marker and node.add_marker will need to get "broken" as well
currently add_marker replaces instead of adding a additional mark

parameterization also does not consider the possibility of more than one
mark of the same value and just puts them into a dict by name (thus
discarding values)
while fixing that i want to discard the broken mechanism of nesting marks
in order to try and expose marking for values (xfail(myvalue) instead of
marked(myvalue, xfail) is just a mess)

the real problem area i see is the really strange and pretty much
incomprehensible mix of keywords, marks, extra-keywords and the various
matcher objects involved in that

i'm not confident at all this mess can be de-tangled without regressions or
planned compatibility breaks,

as such i'd rather plan compatibility breakage than running into regressions

-- Ronny


Red Hat GmbH, http://www.de.redhat.com/, Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Michael Cunningham, Michael
O'Neill, Eric Shander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20160908/9d0bb3c1/attachment.html>

More information about the pytest-dev mailing list