相关疑难解决方法(0)

py.test -n <进程数> =>“py.test:错误:无法识别的参数:-n”

我正在尝试将 django 测试分发到多个进程以加快测试运行。

我在虚拟环境中使用 py.test。

我的相关版本是:

$ pip freeze | grep test
django-pytest==0.2.0
django-webtest==1.7.7
pytest==2.5.2
pytest-cov==1.6
pytest-django==2.6.2
pytest-xdist==1.10
scripttest==1.3
Run Code Online (Sandbox Code Playgroud)

当我尝试命令时:

$ py.test -n 4
Run Code Online (Sandbox Code Playgroud)

我收到错误:

usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: -n
Run Code Online (Sandbox Code Playgroud)

py.test traceconfig 命令显示:

$ py.test --traceconfig
PLUGIN registered: <_pytest.python.FixtureManager instance at 0x1091fd320>
===================================================== test session starts ======================================================
platform darwin -- Python 2.7.2 -- py-1.4.20 -- pytest-2.5.2 --     /Users/mike/virtualenvs/foodnet/bin/python
using: pytest-2.5.2 pylib-1.4.20
setuptools registered plugins:
pytest-cov-1.6 at /Users/mike/virtualenvs/foodnet/lib/python2.7/site-packages/pytest_cov.pyc
pytest-django-2.6.2 at /Users/mike/virtualenvs/foodnet/lib/python2.7/site-packages/pytest_django/plugin.pyc

active plugins:

cacheprovider       : …
Run Code Online (Sandbox Code Playgroud)

python django pytest

5
推荐指数
1
解决办法
3171
查看次数

标签 统计

django ×1

pytest ×1

python ×1