Hi Holger,

I love the pytest.mark.funcarg decorator.

I think pytest.mark.setup is likely a good idea, too, but there are some
questions I'm not clear on:

1. How do I handle teardown for these setup functions? I would expect
they'd take a request and I'd do request.addfinalizer(...), but in some
of your examples they don't seem to take request, and in the one where
it does, it says "In addition to normal funcargs you can also receive
the “request” funcarg which represents a takes on each of the values in
the params=[1,2,3] decorator argument" - which I'm having trouble
parsing, and it isn't clear to me this request object would have
addfinalizer().

2. It's not entirely clear how the two types of scope Floris referred to
earlier (scope based on location of the decorated function, and the
scope keyword passed to the decorator) interact with each other. I
presume that if I have a setup-decorated function in a conftest.py, it
only applies to that directory and subdirectories. If it's located in a
module, I guess it only applies to tests in that module? What if it's
located in a module and I give it scope="session" - what does that mean?
Would that be functionally equivalent to scope="module" in that case,
since it still only applies to that module? Similarly, if I decorate a
method of a class with the setup marker, does it only apply to test
methods on that class?

3. Is there a "class" value for the scope kwarg, in addition to
"session", "module", and "function"? It would be nice to see a full list
of the accepted values for that kwarg.

That's all that comes to mind at the moment! Thanks for all your work on
this.

Carl
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to