[TIP] new test parametrization / deprecating "yield"

holger krekel holger at merlinux.eu
Wed May 13 10:16:30 PDT 2009

Hi all,

thanks to Michael, Doug, Titus and everybody else's comments
and interest on generative tests i'd eventually cleaned up 
the docs and wrote up a blog post about py.test's new 
parametrized tests here:


It discusses three test parametrization approaches, including
Rob's testscenarios.  Concludes with: yielding tests is now 
officially deprecated in favour of using the pytest_generate_tests 
hook which allows to implement all kinds of custom parametrizing approaches. 

To be honest, yield-based tests have always been a bit of a
headache conceptually and implementation wise. So i am quite
happy to have arrived at a solution that seems to substitute
and improve on them as well as on other solutions.  The hook 
is also designed to work well together with distributing tests 
to multiple machines but i leave discussing that to another 
time as it requires conceptually discussing py.test's model of 
distributing test runs. 

best & thanks again for the good discussions here, 

Metaprogramming, Python, Testing: http://tetamap.wordpress.com

More information about the testing-in-python mailing list