python - ImportError when integrating unittesting into bash script -


assume folder 'lib/' contains several unittesting files (ending in '__unittest.py'). conduct unittesting on test files in said folder calling bash script called testing.

michael$ python -m unittest discover -s ./lib/ -p '*__unittest.py' ................... ---------------------------------------------------------------------- ran 19 tests in 0.001s  ok  michael$ bash <(python -m unittest discover -s ./lib/ -p '*__unittest.py') ................... ---------------------------------------------------------------------- ran 19 tests in 0.002s  ok  michael$ echo "python -m unittest discover -s ./lib/ -p '*__unittest.py'" > testing  michael$ bash <(cat testing) eee ====================================================================== error: checkingops__unittest (unittest.loader._failedtest) ---------------------------------------------------------------------- importerror: failed import test module: checkingops__unittest traceback (most recent call last): ... importerror: no module named 'bio' 

it appear cannot conduct unittesting calling bash script, as, then, python not import library bio. why , how can resolve this?

edit 1: same result (of course) when calling script directly.

michael$ bash testing eee ====================================================================== error: checkingops__unittest (unittest.loader._failedtest) ---------------------------------------------------------------------- importerror: failed import test module: checkingops__unittest traceback (most recent call last): ... importerror: no module named 'bio' 


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -