cclib
cclib copied to clipboard
Check imports within test directory
In test/data/testSP.py there is a line:
from common import get_minimum_carbon_separation
- Check imports in test directory again: using local imports like this is dangerous.
- Common functions should go in a file with a more descriptive name than
common, maybetest_utils. Combine with absolute/relative import.
So we cannot do absolute import for these currently, because test file don't get installed. I guess it makes sense to move the utils (current common) to the installed part and absolutely import that. Not sure we can do much about import actual test modules... those probably need to stay relative.
I suppose we can move the test directory into cclib and then the imports in test files would be from cclib.test.data testSP or similar, and would still be local (not installed) when run with python -m cclib.test.test_data. Thoughts?
(pushing back to v1.6.2)
I have noticed that the MolSSI cookiecutter (and perhaps the original) places tests inside the top-level module, rather than alongside it as we have now. I support that change.