Gar*_*ler 5 python testing packages nose
项目树:
.
|-- bar.py
`-- test
|-- __init__.py
`-- test_bar.py
Run Code Online (Sandbox Code Playgroud)
bar.py:
def dumb_true():
return True
Run Code Online (Sandbox Code Playgroud)
测试/ test_bar.py:
import bar
def test_bar_true():
assert bar.dumb_true()
Run Code Online (Sandbox Code Playgroud)
我可以nosetests
从项目内部或其测试目录中运行.__init__.py
但是,如果我在项目文件夹中添加一个空,我就不能再nosetests
从test目录中运行了,这对我没有任何意义.
.
|-- bar.py
|-- __init__.py <-- new, empty file, ruining everything
`-- test
|-- __init__.py
`-- test_bar.py
Run Code Online (Sandbox Code Playgroud)
任何人都可以向我解释这里发生了什么?
我已经在这个主题上广泛阅读 - 通过鼻子文档/手册页和整个互联网; 但是我觉得这一切都解决了,这看起来很混乱!
归档时间: |
|
查看次数: |
1430 次 |
最近记录: |