8000 Merge pull request #21907 from meeseeksmachine/auto-backport-of-pr-21… · matplotlib/matplotlib@a73fd66 · GitHub
[go: up one dir, main page]

Skip to content

Commit a73fd66

Browse files
authored
Merge pull request #21907 from meeseeksmachine/auto-backport-of-pr-21905-on-v3.5.x
Backport PR #21905 on branch v3.5.x (Fix image testing decorator in pytest importlib mode)
2 parents 0c9ca6b + f3e15ff commit a73fd66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def _image_directories(func):
479479
``$(pwd)/result_images/test_baz``. The result directory is created if it
480480
doesn't exist.
481481
"""
482-
module_path = Path(sys.modules[func.__module__].__file__)
482+
module_path = Path(inspect.getfile(func))
483483
baseline_dir = module_path.parent / "baseline_images" / module_path.stem
484484
result_dir = Path().resolve() / "result_images" / module_path.stem
485485
result_dir.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)
0