From 4a20d0fbe2c8af0478246ae716d506e12a6112a0 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 18 Sep 2025 02:02:04 -0400 Subject: [PATCH] TST: Force Agg backend in test_openin_any_paranoid On some CI, the Qt backend seems to be picked, but something is confused and it fails due to an invalid `DISPLAY` variable. But this test doesn't need an interactive backend, so don't use one. --- lib/matplotlib/tests/test_texmanager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/tests/test_texmanager.py b/lib/matplotlib/tests/test_texmanager.py index 64dcbf46456d..7e7b5632c7ac 100644 --- a/lib/matplotlib/tests/test_texmanager.py +++ b/lib/matplotlib/tests/test_texmanager.py @@ -70,6 +70,7 @@ def test_openin_any_paranoid(): 'import matplotlib.pyplot as plt;' 'plt.rcParams.update({"text.usetex": True});' 'plt.title("paranoid");' - 'plt.show(block=False);'], - env={**os.environ, 'openin_any': 'p'}, check=True, capture_output=True) + 'plt.gcf().canvas.draw();'], + env={**os.environ, 'MPLBACKEND': 'Agg', 'openin_any': 'p'}, + check=True, capture_output=True) assert completed.stderr == ""