[pytest-dev] Fwd: Re: Proposal: python namespacign for markings/marker objects

Florian Bruhin me at the-compiler.org
Thu Oct 20 03:17:12 EDT 2016


* Ronny Pfannschmidt <opensource at ronnypfannschmidt.de> [2016-10-20 09:07:47 +0200]:
> > Finally, and I only just remembered, Holger has some lingering code
> > somewhere which does something like:
> >
> > @pytest.marker
> > def blocker(n):
> >     return {'issue no': int(n)}  # or whatever object you want your marker to be
> >
> > @pytest.mark.blocker(123)
> > def test_fun():
> >     pass
> fixtures and markers are not symmetric and i don't see a reason to make
> them be
> just for looking similar, currently they are *completely* different ,
> and i think that bringing them closer to look more nice will make things
> MUCH worse.
> they are belonging to different categories of "things" with completely
> different desired behaviours.

Then don't think of them like fixtures - but markers are essentially
*functions*. They have arguments and keyword arguments, and currently
everything defining a marker with arguments has to do the
parsing/validating by itself. Holger's proposal seemed to clean this
up and make things a lot easier.

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20161020/93943fdf/attachment-0001.sig>


More information about the pytest-dev mailing list