Skip to content

TST: Fix minor issues in interactive backend test #28838

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

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions lib/matplotlib/tests/test_backends_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ def _test_interactive_impl():

if backend.endswith("agg") and not backend.startswith(("gtk", "web")):
# Force interactive framework setup.
plt.figure()
fig = plt.figure()
plt.close(fig)

# Check that we cannot switch to a backend using another interactive
# framework, but can switch to a backend using cairo instead of agg,
Expand Down Expand Up @@ -224,10 +225,7 @@ def check_alt_backend(alt_backend):
result_after = io.BytesIO()
fig.savefig(result_after, format='png')

if not backend.startswith('qt5') and sys.platform == 'darwin':
# FIXME: This should be enabled everywhere once Qt5 is fixed on macOS
# to not resize incorrectly.
assert result.getvalue() == result_after.getvalue()
assert result.getvalue() == result_after.getvalue()


@pytest.mark.parametrize("env", _get_testable_interactive_backends())
Expand Down Expand Up @@ -444,8 +442,7 @@ def qt5_and_qt6_pairs():

for qt5 in qt5_bindings:
for qt6 in qt6_bindings:
for pair in ([qt5, qt6], [qt6, qt5]):
yield pair
yield from ([qt5, qt6], [qt6, qt5])


@pytest.mark.parametrize('host, mpl', [*qt5_and_qt6_pairs()])
Expand Down
Loading