
[英]Is there a way to control how pytest-xdist runs tests in parallel?
[英]Pytest-xdist works with pip but not with pipenv. No tests are loaded/scheduled
当我通过pip和pipenv安装Pytest
时,它可以工作。 但是,当通过命令pytest -n 4
使用pytest-xdist
插件时,这仅适用于pip
而不适用于pipenv
。 没有计划或加载任何测试。
mohammad@mohammad-XPS-15-9550:~/Documents/cs203/gatorgrouper$ pipenv run pytest tests/ -n 4
Test session starts (platform: linux, Python 3.6.7, pytest 4.2.1, pytest-sugar 0.9.2)
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/mohammad/Documents/cs203/gatorgrouper/.hypothesis/examples')
rootdir: /home/mohammad/Documents/cs203/gatorgrouper, inifile: pytest.ini
plugins: xdist-1.26.1, sugar-0.9.2, forked-1.0.2, cov-2.6.1, clarity-0.1.0a1, hypothesis-4.5.11
[gw0] linux Python 3.6.7 cwd: /home/mohammad/Documents/cs203/gatorgrouper
[gw1] linux Python 3.6.7 cwd: /home/mohammad/Documents/cs203/gatorgrouper
[gw2] linux Python 3.6.7 cwd: /home/mohammad/Documents/cs203/gatorgrouper
[gw3] linux Python 3.6.7 cwd: /home/mohammad/Documents/cs203/gatorgrouper
[gw0] Python 3.6.7 (default, Oct 22 2018, 11:32:17) -- [GCC 8.2.0]
[gw1] Python 3.6.7 (default, Oct 22 2018, 11:32:17) -- [GCC 8.2.0]
[gw2] Python 3.6.7 (default, Oct 22 2018, 11:32:17) -- [GCC 8.2.0]
[gw3] Python 3.6.7 (default, Oct 22 2018, 11:32:17) -- [GCC 8.2.0]
gw0 [0] / gw1 [0] / gw2 [0] / gw3 [0]
scheduling tests via LoadScheduling
Results (1.05s):
这是我当前的pipfile:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
pylint = "*"
black = "*"
pytest = "*"
six = "*"
codecov = "*"
"flake8" = "*"
pytest-cov = "*"
neovim = "*"
pytest-sugar = "*"
pytest-clarity = "*"
autopep8 = "*"
gspread = "*"
oauth2client = "*"
pytest-xdist = "*"
[packages]
pathlib = "*"
py = "*"
[requires]
python_version = "3.6"
[pipenv]
allow_prereleases = true
这也发生在我身上。 似乎pytest-xdist不支持pytest-clarity。 只需将其删除。 现在,再次并行启动测试应该适用于您。
pip uninstall pytest-clarity
问候!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.