Opened 11 years ago
Closed 10 years ago
#355 closed defect (fixed)
nose and modules with optional library deps
|Reported by:||Elrond||Owned by:||Elrond|
Description (last modified by )
During unit tests nose imports every ``*.py`` it finds in the tree. It does so to search for unit tests there. If the import fails, this gives an error in the final unit test results. For GMG this can fail, because some modules import optional libraries (video for example). Currently known options: 1. Add hard dependencies again for all optional libraries. Not nice, but would solve the problem at hand. 2. Rewrite the affected modules to somehow gracefully handle the situation and not error. Not really nice, but acceptable. 3. Change ``runtests.sh`` to call nose in a way, that tests are only searched in ``mediagoblin.tests``. This seems the nicest way.
Change History (6)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Update: This affects only ``__init__.py`` and modules imported from there. Some random ``models.py`` importing say sqlalchemy doesn't trigger this issues on its own.
comment:3 by , 11 years ago
The original url for this bug was http://bugs.foocorp.net/issues/708 .
comment:4 by , 10 years ago
Giving a path to nosetests can easily prevent most of this problem. It tells it to search only for tests in the given directory, like so:
We could easily modify
runtests.sh to add this argument on its own, if no other relevant args are given.
Do we want that?
Are all our tests going to be in
mediagoblin/tests? Or are tests for core plugins going to be in their individual directories? Maybe not, because
mediagoblin/tests/__init__.py has some setup code for tests.
What do others think?
(hinted by ShawnRisk)
comment:5 by , 10 years ago
|Status:||accepted → assigned|
The above mentioned idea for changing
runtests.sh has been implemented by me in
In my opinion, we can close this issue. Any vetos? (set milestone to next release, so we revisit it sooner than later for just closing or postponing.)
comment:6 by , 10 years ago
|Status:||assigned → closed|