Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05b56ea

Browse files
authored
Merge pull request #21905 from QuLogic/pytest-importlib-mode
Fix image testing decorator in pytest importlib mode
2 parents 8f1602b + c1b430b commit 05b56ea

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
@@ -502,7 +502,7 @@ def _image_directories(func):
502502
``$(pwd)/result_images/test_baz``. The result directory is created if it
503503
doesn't exist.
504504
"""
505-
module_path = Path(sys.modules[func.__module__].__file__)
505+
module_path = Path(inspect.getfile(func))
506506
baseline_dir = module_path.parent / "baseline_images" / module_path.stem
507507
result_dir = Path().resolve() / "result_images" / module_path.stem
508508
result_dir.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)