Skip to content

Commit

Permalink
Backport PR matplotlib#21905: Fix image testing decorator in pytest i…
Browse files Browse the repository at this point in the history
…mportlib mode
  • Loading branch information
jklymak authored and meeseeksmachine committed Dec 10, 2021
1 parent b8a60b9 commit f3e15ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/matplotlib/testing/decorators.py
Expand Up @@ -479,7 +479,7 @@ def _image_directories(func):
``$(pwd)/result_images/test_baz``. The result directory is created if it
doesn't exist.
"""
module_path = Path(sys.modules[func.__module__].__file__)
module_path = Path(inspect.getfile(func))
baseline_dir = module_path.parent / "baseline_images" / module_path.stem
result_dir = Path().resolve() / "result_images" / module_path.stem
result_dir.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit f3e15ff

Please sign in to comment.