简体   繁体   English

在Ubuntu上的py.test

[英]py.test on Ubuntu

I try to run a series of test cases on Ubuntu with py.test and is not collecting my test cases from a folder. 我尝试使用py.test在Ubuntu上运行一系列测试用例,但没有从文件夹中收集测试用例。 I use unittest to write test cases. 我使用unittest编写测试用例。

On Windows i use this command: 在Windows上,我使用以下命令:

py.test –v "folder with test cases" > log_file.txt

The output from Windows: 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

Same command on Ubuntu, the output is: 在Ubuntu上执行相同的命令,输出为:

============================= test session starts ==============================
platform linux2 -- Python 2.7.3 -- pytest-1.3.4
test path 1: TestScenario01/

===============================  in 0.01 seconds ===============================

I use different Python versions, because on Windows Scapy works only with Python 2.6. 我使用不同的Python版本,因为在Windows Scapy中仅适用于Python 2.6。 Another difference is that on Windows appears py-1.4.20 and pytest-2.5.2. 另一个区别是在Windows上出现py-1.4.20和pytest-2.5.2。 I have them installed on Ubuntu too. 我也将它们安装在Ubuntu上。

I managed to start tests. 我设法开始测试。 I had to remove the old py-1.3.4 module and install py-1.4.2 and also had to upgrade pytest to version 2.5.2. 我必须删除旧的py-1.3.4模块并安装py-1.4.2,还必须将pytest升级到版本2.5.2。 Now it works. 现在可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM