Possible to use unittest-like fixtures in py.test?
I really like py.test
, but I am having lots of difficulty understanding how funcargs
work.
Is it possible to use a command line argument or an extension to enable the use of s开发者_如何学运维omething that performs a similar role to unittest.TestCase.setUp
and unittest.TestCase.tearDown
?
py.test supports "normal" xunit method-based fixtures by default, see:
http://codespeak.net/py/dist/test/xunit_setup.html
Alternatively you can subclass from unittest.TestCase and use .setUp/tearDown but the latter may be a bit limited.
精彩评论