Unit testing django stupid mista

2017-10-03  本文已影响0人  AtrributeError

ImportError: '<test>' module incorrectly imported from '<base-env>/local/lib/python2.7/site-packages/<package-dir>'. Expected '<base-env>/lib/python2.7/site-packages/<package-dir>'. Is this module globally installed?
Check out the layout as"
my_app/
init.py
tests.py
tests/
init.py
test_foo.py
The problem was generated by having both a "tests.py" module and a "tests" package in the same folder.

Just deleting the "tests.py" file solved the problem

上一篇下一篇

猜你喜欢

热点阅读