Tox WARNING:test command found but not installed in testenv

后端 未结 4 1130
甜味超标
甜味超标 2021-02-19 13:11

I am using tox for my project.

Here is my tox.ini file:

[tox]
envlist =
    py27,
    lint,
    coverage

skipsdist = True

[testenv:py27]
dep         


        
相关标签:
4条回答
  • 2021-02-19 13:42

    https://tox.readthedocs.io/en/latest/config.html

    here ,set this option,maybe,you pass

    sitepackages=false(true|false) Set to true if you want to create virtual environments that also have access to globally installed packages.

    Warning In cases where a command line tool is also installed globally you have to make sure that you use the tool installed in the virtualenv by using python -m (if supported by the tool) or {envbindir}/.

    If you forget to do that you will get a warning like this:

    WARNING: test command found but not installed in testenv
        cmd: /path/to/parent/interpreter/bin/<some command>
        env: /foo/bar/.tox/python
    Maybe you forgot to specify a dependency? See also the whitelist_externals envconfig setting.
    
    0 讨论(0)
  • 2021-02-19 13:46

    The question is old but the answers do not apply to my situation. In my case, once I changed the [testenv] to [env], it works. This is because my Python virtual environment is named as "env".

    0 讨论(0)
  • 2021-02-19 13:46

    I don't know why, but to solve I had to clone my repo again. The repo reset doesn't solve only the full clone.

    Checkout this tox issue for more details.

    0 讨论(0)
  • 2021-02-19 13:49

    Programs that you use in commands must either be installed in tox' virtual environment or whitelisted:

    [tox]
    envlist =
        py27,
        lint,
        coverage
    
    skipsdist = True
    
    [testenv:py27]
    deps = -rrequirements.txt
    whitelist_externals = python
    commands = python -m unittest discover -s ./tests
    
    [testenv:coverage]
    whitelist_externals = coverage
    commands =
        coverage run --source=tests -m unittest discover -s tests/
        coverage html
        coverage report
    
    
    [testenv:lint]
    whitelist_externals = pylint
    commands = pylint ./foo
    
    0 讨论(0)
提交回复
热议问题