簡體   English   中英

在Ubuntu上的py.test

[英]py.test on Ubuntu

我嘗試使用py.test在Ubuntu上運行一系列測試用例,但沒有從文件夾中收集測試用例。 我使用unittest編寫測試用例。

在Windows上,我使用以下命令:

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。 現在可以了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM