python 3.x - Module imported correctly when using unittest but not with nose2 -


i got tests, run when calling them python -m unittest discover -s tests fail when try run them nose2 -s tests due import error.

i have following folder structure , want test either installed package or src code itself:

project_folder |_src | |_my_package |   |___init__.py |   |_core.py |   |_helpers.py |   |_... |_tests | |_test_helpers.py |_unittest.cfg |_setup.py |_... 

in test_helpers.py import:

import unittest nose.tools import raises import em_ptc_queries.helpers 

when call python -m unittest discover -s tests, tests run correctly. when call nose2 -s tests tests fail due to:

modulenotfounderror: no module named 'my_package.helpers' 

fyi: code within src folder without __init__.py if call tests project_folder, tests use installed package , if call within project_folder\src test code not installed.

in python console import my_package.helpers works correctly from my_package import helpers.

is there miss when trying use nose2?


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -