Skip to content

Commit 1e4823b

Browse files
committed
Merge pull request #5387 from jenshnielsen/pipmptesting
Fix #3314 assert mods.pop(0) fails
1 parent feaf9c6 commit 1e4823b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/matplotlib/testing/decorators.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,13 @@ def _image_directories(func):
328328
subdir = os.path.splitext(os.path.split(script_name)[1])[0]
329329
else:
330330
mods = module_name.split('.')
331-
mods.pop(0) # <- will be the name of the package being tested (in
332-
# most cases "matplotlib")
331+
if len(mods) >= 3:
332+
mods.pop(0)
333+
# mods[0] will be the name of the package being tested (in
334+
# most cases "matplotlib") However if this is a
335+
# namespace package pip installed and run via the nose
336+
# multiprocess plugin or as a specific test this may be
337+
# missing. See https://github.com/matplotlib/matplotlib/issues/3314
333338
assert mods.pop(0) == 'tests'
334339
subdir = os.path.join(*mods)
335340

0 commit comments

Comments
 (0)