0

in my python project , all my test cases not import some package the main program imported,but when i run nosetests in the project dir,if my environment has not install some package the main program has imported ,it will occur failed about "No module named XXXX".

why nosetests will check these modules which the main program import whether has be installed?

  • 1
    I can't frankly understand what you are asking for. Can you give sample code? – finiteautomata Jan 08 '14 at 15:06
  • 1
    Try to improve your English. How is this related to nosetest? Does it work if you run your tests in some other way? – Mattias Jan 08 '14 at 15:08
  • Thank you very much.For example,my main.py start with `import chardet`,and my test_main.py is empty.In the commandline i enter `nosetests`,it occurs `"No module named chardet"`. – user3099830 Jan 08 '14 at 15:39
  • Can you do `python main.py`? – finiteautomata Jan 08 '14 at 15:51
  • Please, also provide full stack of the error running nosetests. – finiteautomata Jan 08 '14 at 15:53
  • my work environment has not install chardet module,after i install the chardet module and run nosetests,the error not appears.why nosetests will check the module in main.py? – user3099830 Jan 08 '14 at 15:57
  • Thank you for your watch.I will explain my problem more clear and provide the full stack of the error tomorrow,because this computer has no my work environment,i will provide the error in my work computer tomorrow.Thank you very much! – user3099830 Jan 08 '14 at 16:19
  • I'm sorry .My problem is in my build.xml ,the test is before than release ,in test,has this:``.During the release will download these packages i need.But in the test will occur "No module named chardet".My testcases not import chardet. – user3099830 Jan 09 '14 at 16:18

0 Answers0