Python Ubuntu上的py.test
我试图用py.test在Ubuntu上运行一系列测试用例,但没有从文件夹中收集测试用例。我使用unittest编写测试用例 在Windows上,我使用以下命令:Python Ubuntu上的py.test,python,pytest,python-unittest,Python,Pytest,Python Unittest,我试图用py.test在Ubuntu上运行一系列测试用例,但没有从文件夹中收集测试用例。我使用unittest编写测试用例 在Windows上,我使用以下命令: py.test –v "folder with test cases" > log_file.txt Windows的输出: ============================= test session starts ============================= platform win32 -- Pyth
py.test –v "folder with test cases" > log_file.txt
Windows的输出:
============================= test session starts =============================
platform win32 -- Python 2.6.3 -- py-1.4.20 -- pytest-2.5.2 -- C:\Python26\python.exe
plugins: capturelog
collecting ... collected 27 items
Ubuntu上的相同命令,输出为:
============================= test session starts ==============================
platform linux2 -- Python 2.7.3 -- pytest-1.3.4
test path 1: TestScenario01/
=============================== in 0.01 seconds ===============================
我使用不同的Python版本,因为在Windows上,Scapy仅适用于Python 2.6。另一个区别是,在Windows上显示的是py-1.4.20和pytest-2.5.2。我也在Ubuntu上安装了它们。我设法启动了测试。我必须删除旧的py-1.3.4模块并安装py-1.4.2,还必须将pytest升级到2.5.2版。现在它可以工作了。您的测试用例是否以
test\uuuz
为前缀?它们是testTS0x
。我有setup.cfg:python\u files=*.py python\u classes=TS*python\u functions=test*
正确,请检查以确保