#213 closed defect (wontfix)
tests can't load dependent modules
Reported by: | onlyjob | Owned by: | Antoine Martin |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Testing | Keywords: | patch |
Cc: |
Description
Many unit tests fail to load because they can't find their modules:
Traceback (most recent call last): File "tests/window_xlib_test.py", line 8, in <module> from winswitch.util.simple_logger import Logger ImportError: No module named winswitch.util.simple_logger
Perhaps there is a more elegant way to fix that what I did in the attached patch, but it works for me.
Thanks.
Attachments (1)
Change History (6)
Changed 12 years ago by
Attachment: | tests.patch added |
---|
comment:1 Changed 12 years ago by
Owner: | changed from Antoine Martin to Antoine Martin |
---|---|
Status: | new → accepted |
Hmmm, I set PYTHONPATH
when I run them, but you're right that they should work out of the box. Let me think of something... (I don't particularly like the patch approach)
comment:2 Changed 12 years ago by
Patch must be horrible and ugly because I don't know python at all. :)
It is merely a dirty fix to the extent of my ignorance.
I'm sure you know how to make it better.
Perhaps I should try setting PYTHONPATH as you do...
Thank you.
Cheers,
Dmitry.
comment:3 Changed 12 years ago by
Thanks for PYTHONPATH hint.
IMHO this bug can be closed by providing script to properly invoke tests that are reasonable to run after every build, as batch.
comment:4 follow-up: 5 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | accepted → closed |
export PYTHONPATH=. ./tests/sound/sound_util_test.py ./tests/util/utmp_test.py #etc
Sorry but there is nothing to fix in the code itself, just set PYTHONPATH
.
comment:5 Changed 12 years ago by
Many thanks - I already dropped the patch from packaging in favour of PYTHONPATH (can you believe, I didn't know about it).
patch