Skip to content

Commit

Permalink
Fix #3314 assert mods.pop(0) fails
Browse files Browse the repository at this point in the history
mods[0] does not contain the package name when installing via pip and running the multiprocess nose plugin. In the long term we should get rid of the namespace package
  • Loading branch information
jenshnielsen committed Nov 3, 2015
1 parent f7cf17f commit 9803924
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/matplotlib/testing/decorators.py
Expand Up @@ -328,8 +328,13 @@ def _image_directories(func):
subdir = os.path.splitext(os.path.split(script_name)[1])[0]
else:
mods = module_name.split('.')
mods.pop(0) # <- will be the name of the package being tested (in
# most cases "matplotlib")
if len(mods) >= 3:
mods.pop(0)
# mods[0] will be the name of the package being tested (in
# most cases "matplotlib") However if this is a
# namespace package pip installed and run via the nose
# multiprocess plugin or as a specific test this may be
# missing. See https://github.com/matplotlib/matplotlib/issues/3314
assert mods.pop(0) == 'tests'
subdir = os.path.join(*mods)

Expand Down

0 comments on commit 9803924

Please sign in to comment.