views:

25

answers:

1

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 something that performs a similar role to unittest.TestCase.setUp and unittest.TestCase.tearDown?

+1  A: 

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.

hpk42
Thanks! I was certain that this was possible, because I've heard you mention in your talks.
Tim McNamara