Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix image testing decorator in pytest importlib mode #21905

Merged
merged 1 commit into from Dec 10, 2021

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Dec 10, 2021

PR Summary

In importlib mode, files are not added to sys.modules, so we cannot use that to find the file path.

Fixes #21885

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [n/a] New features are documented, with examples if plot related.
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).

In importlib mode, files are not added to `sys.modules`, so we cannot
use that to find the file path.

Fixes matplotlib#21885
@QuLogic QuLogic added this to the v3.5.2 milestone Dec 10, 2021
@jklymak jklymak modified the milestones: v3.5.2, v3.5.1 Dec 10, 2021
@jklymak jklymak merged commit 05b56ea into matplotlib:main Dec 10, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Dec 10, 2021
@QuLogic QuLogic deleted the pytest-importlib-mode branch December 10, 2021 07:13
jklymak added a commit that referenced this pull request Dec 10, 2021
…905-on-v3.5.x

Backport PR #21905 on branch v3.5.x (Fix image testing decorator in pytest importlib mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: test decorator breaks with new pytest importlib mode
3 participants