[英]How do I get pytest to run all functions as test
我環顧四周,找不到pytest.ini標志傳遞,該標志表示
def test_one():
# you run this by default
def two():
# despite not having test in the name you should also run this
原因:當我使用命名進行描述時,測試功能名稱的長度越來越長,坦率地說,它似乎很干燥。
從文檔
# 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
只有*
在那里,你設置。
嘗試如下所示,它將要求所有python文件進行py.test集合測試。
# content of pytest.ini
[pytest]
python_files = *.py
您可以檢查文檔的這一部分,
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.