[英]tox throws “tox: error: unrecognized arguments:” for a seemingly valid command
[英]tox throws and error when running nosetest command
我創建了這個tox.ini
文件:
[tox]
envlist = py37
[testenv]
commands = /bin/sh nosetests config_test.test_config_sdk:test_bucket_existing
它引發此錯誤:
$ tox
GLOB sdist-make: /Users/me/git/config-test/setup.py
py37 create: /Users/me/git/config-test/.tox/py37
py37 inst: /Users/me/git/config-test/.tox/.tmp/package/1/sdk-config-1.0.0.zip
py37 installed: sdk-config==1.0.0,config-test==1.0.0
py37 run-test-pre: PYTHONHASHSEED='2567467531'
py37 runtests: commands[0] | /bin/sh nosetests config_test.test_config_sdk:test_bucket_existing
/Users/me/git/config-test/venv/bin/nosetests: line 3: import: command not found
/Users/me/git/config-test/venv/bin/nosetests: line 4: import: command not found
from: can't read /var/mail/nose
/Users/me/git/config-test/venv/bin/nosetests: nosetests: line 9: syntax error near unexpected token `('
/Users/me/git/config-test/venv/bin/nosetests: nosetests: line 9: ` sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])'
ERROR: InvocationError for command '/bin/sh nosetests config_test.test_config_sdk:test_bucket_existing' (exited with code 2)
__________________________________________________________________________ summary ___________________________________________________________________________
ERROR: py37: commands failed
nosetests config_test.test_config_sdk:test_bucket_existing
可以在終端上運行。
我做錯了什么嗎,或者這個命令無法在tox中執行?
這是您注冊的tox
運行命令:
/bin/sh nosetests config_test.test_config_sdk:test_bucket_existing
在這里, nosetests
被作為shell腳本調用; 但這是誤導。
nosetests
是您PATH
的可執行python腳本,應直接執行。
將命令注冊為:
nosetests config_test.test_config_sdk:test_bucket_existing
解決錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.