簡體   English   中英

禁用pytest插件在本地工作,在CI上不工作

[英]Disabling pytest plugin works locally, doesn't work on CI

我有一個pytest設置,其中包含用於集成測試的以下配置文件:

[pytest]
addopts = -p no:python -p no:random-order --tb=short
junit_suite_name = Integration
filterwarnings =
    ignore::DeprecationWarning

目的是不加載random-order插件。 在本地運行時,將其作為輸出:

$ pytest -c pytest-integration.ini --junitxml=integration-tests.xml tests/integration/

======================= test session starts ===========================
platform darwin -- Python 3.6.4, pytest-3.7.2, py-1.7.0, pluggy-0.8.0
rootdir: /Users/ringods/Projects/customer/project/tests/integration, 
inifile: pytest-integration.ini
plugins: cov-2.6.0, mamba-1.0.0
collected 629 items

不出所料,沒有任何random-order插件的痕跡。 我將更改推送到構建服務器(Jenkins),這是Jenkins的輸出:

+ pytest -c pytest-integration.ini --junitxml=integration-tests.xml tests/integration/

===================== test session starts ========================
platform linux -- Python 3.6.3, pytest-3.7.2, py-1.7.0, pluggy-0.8.0
Test order randomisation NOT enabled. Enable with --random-order or -- random-order-bucket=<bucket_type>
rootdir: /home/centos/workspace/test-reporting-L2CS5UFPVK3I5UNI6BJIMJPWQQMDOV465LKDS2BSKJ5UXDZGAI6Q/tests/integration, inifile: pytest-integration.ini
plugins: random-order-1.0.4, cov-2.6.0, mamba-1.0.0
collected 629 items

我似乎找不到為什么仍然加載random-order插件的原因。 誰能幫我嗎?

確保您在本地使用的配置文件與Jenkins中的相同。 請檢查您是否還推送了配置文件中的更改。

暫無
暫無

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

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