【发布时间】:2018-10-13 19:50:42
【问题描述】:
我通常使用tox 运行我的测试,它调用pytest。此设置在许多项目中都可以正常工作。然而,在某些项目中,我有一些需要很长时间(几分钟)的测试。我不想每次都运行它们。我想把测试装饰一下。
类似这样的:
$ tox --skip-long
和
# core modules
import unittest
class Foo(unittest.TestCase):
def test_bar(self):
...
@long
def test_long_bar(self):
...
How can I do this?
【问题讨论】:
-
一个相关的问题是如果测试时间过长如何跳过测试:stackoverflow.com/questions/19527320/…
标签: pytest python-decorators tox