开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜