[英]Why do I get the error “Invalid command nosetests” when I run nosetests from my virtualenv?
[英]How do I get error messages from nosetests
nosetest
命令失败,没有任何消息。 如果我 cd 到我的主目录,我会收到我期望的消息:
(base) raysalemi@RayProMac ~ % nosetests
----------------------------------------------------------------------
Ran 0 tests in 0.003s
OK
但是如果我 cd 到我的测试目录,我会得到这个:
/Users/raysalemi/repos/pyuvm/tests/nosetests
(base) raysalemi@RayProMac nosetests % ls
__pycache__ pyuvm_unittest.py test_05_base_classes.py test_06_reporting_classes.py
(base) raysalemi@RayProMac nosetests % nosetests
(base) raysalemi@RayProMac nosetests % echo $?
1
这已经运行了几个月,所以我不确定更改,但我无法收到要检查的错误消息,只能查看退出状态。
建议?
解决方案是 CD 到我的测试目录并在同一命令行上运行 python 和 unittest 模块:
(base) raysalemi@RayProMac nosetests % python -m unittest
No module named 'copyz'
No module named 'copyz'
EE
我不小心将z
插入到我的代码中,导致导入失败。 获取该消息的唯一方法是直接使用unittest
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.