我有一个python应用程序的测试套件,可以用nose2运行。你知道吗
我以前把所有的测试都放在一个文件中;但是,这个文件有超过1500行的长度,所以我把它分成了多个独立的文件。你知道吗
这套房以前是这样的:
tests/
test_all.py
我将在tests
目录外使用以下命令运行一个测试:
nose2 tests.test_all.MyTestCase.test_something
现在我的套房看起来像这样:
tests/
base.py
test_inputs.py
test_outputs.py
test_reports.py
测试base.py
(它只是设置测试类,本身没有测试)工作正常:
nose2 tests.base
但是当我运行以下命令时,我得到一个AttributeError: 'module' object has no attribute 'test_output'
:
nose2 tests.test_output
进一步回溯,我看到以下错误:ImportError: No Module named 'base'
。如何告诉nose2
使用base.py
?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐