【发布时间】:2013-11-29 01:27:19
【问题描述】:
我正在尝试创建不基于单元测试的测试类。
这个类下的这个方法
class ClassUnderTestTests:
def test_something(self):
当您从命令行调用 py.test 或在 PyCharm 中运行此测试(它在自己的模块上)时,无法检测和运行。
这个
def test_something(self):
可以检测并运行类外的相同方法。
我想将我的测试归类,除非我遗漏了什么,否则我会关注 py.test spec 来做到这一点。
环境:Windows 7,将 py.test 设置为测试运行器的 PyCharm。
【问题讨论】:
-
您可以使用测试目录根目录下的 pytest.ini 来自定义 pytest 配置 pytest.org/latest/customize.html
标签: python unit-testing pycharm pytest