djay0529 / mdanalysis

Automatically exported from code.google.com/p/mdanalysis
0 stars 0 forks source link

relative imports and nosetests #189

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently have to do: nosetests-2.7 test_analysis.py:Test_Helanal

and not: nosetests-2.7 test_analysis:Test_Helanal

because of a relative import problem. Since the wiki docs advertise the version 
without the .py, it is perhaps suitable to have a consistent policy on whether 
we will allow Python relative imports in unit test modules. It seems that we 
can mostly work around relative imports, except for things that were placed in 
the testing __init__.py

Original issue reported on code.google.com by tyler.je.reddy@gmail.com on 8 Jul 2014 at 7:39

GoogleCodeExporter commented 9 years ago
Tyler,

I like the second version

  nosetests-2.7 test_analysis:Test_Helanal

better.

If we can make this work by banning relative imports in the UnitTests (but not 
in the package MDAnalysis itself) then I think we should do so.

Has anyone else arguments for/against?

Oliver

Original comment by orbeckst on 14 Jul 2014 at 7:29