Closed alexanderlukanin13 closed 8 years ago
I'll rather refactor the tests themselves, it's just as fast. Since py.test is our primary test tool, I'm going to use fixtures.
By the way, you can leave pull request open if it's not good enough - just leave a comment and I'll add appropriate changes.
Sphinx requires all your modules to be importable without major side-effects (that is, no executable code at global level). There were two nasty problems preventing Sphinx from working properly.
var_names.py
, default dict was initialized at import time. I changed that to lazy initialization on first use. Still not very portable (it uses relative path), but at least it doesn't fail on import.test_label_csv.py
, some test data was initialized on global level (again, using relative import described above). For now, I simply copypasted necessary calls into individual tests. We can later refactor it to use a common test class or something.Also, I added
test_import.py
to make sure this problem won't happen again.