我环顾四周,找不到传递的pytest.ini标志,相当于
def test_one():
# you run this by default
def two():
# despite not having test in the name you should also run this
原因:当我用命名描述时,测试函数名称的长度变得越来越长,坦率地说它似乎是反干的。
答案 0 :(得分:1)
# content of setup.cfg
# can also be defined in in tox.ini or pytest.ini file
[pytest]
python_files=check_*.py
python_classes=Check
python_functions=*_check
将“*_check
替换为*
,然后设置。
答案 1 :(得分:0)
尝试如下所示,它将从所有python文件中询问py.test集合测试。
# content of pytest.ini
[pytest]
python_files = *.py
你可以查看这部分文件,