[py-dev] Re: [py-svn] r7784 - in py/dist/py: . test
holger krekel
hpk at trillke.net
Thu Dec 9 00:49:49 CET 2004
Hi Ian, hi All,
i have implemented generative tests:
> New Revision: 7784
> implemented support for Generator (collection) functions and methods.
> plus a couple of tests.
>
> With this new hack you can yield parametrized tests in an easy
> ("the best API is one that doesn't exist") way:
>
> def somefunc(x, y):
> assert x * y == 42
>
> def test_generator():
> yield somefunc, 6, 7
> yield somefunc, 7, 6
However, i am not completly sure yet about appropriate
setup/teardown semantics. Should setup_method()/teardown_method()
be performed for each run of a generated callable+*args/**kwargs thingie
or just for the test generator itself? (test generator = the
test function that actually yields callables/args/kwargs
tuples).
cheers,
holger
More information about the Pytest-dev
mailing list