Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit196c8db

Browse files
committed
TST: Followup corrections to#28205
Make the changes suggested by@ianthomas23, and also mark the ipythontests as using their backend. While the backend is already checked foravailability at the top of the respective files, that only checkswhether it can be imported, not whether it can be set as the Matplotlibbackend. Adding the marker causes our pytest configuration to actuallycheck and skip the test if unavailable (e.g., on Linux without`(WAYLAND_)DISPLAY` set fails to set an interactive backend).
1 parentd8f3016 commit196c8db

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

‎lib/matplotlib/testing/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,4 @@ def ipython_in_subprocess(requested_backend_or_gui_framework, all_expected_backe
210210
capture_output=True,
211211
)
212212

213-
assertproc.stdout.strip()==f"Out[1]:'{expected_backend}'"
213+
assertproc.stdout.strip().endswith(f"'{expected_backend}'")

‎lib/matplotlib/tests/test_backend_inline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
importos
22
frompathlibimportPath
33
fromtempfileimportTemporaryDirectory
4+
importsys
45

56
importpytest
67

@@ -12,6 +13,7 @@
1213
pytest.importorskip('matplotlib_inline')
1314

1415

16+
@pytest.mark.skipif(sys.version_info[:2]<= (3,9),reason="Requires Python 3.10+")
1517
deftest_ipynb():
1618
nb_path=Path(__file__).parent/'test_inline_01.ipynb'
1719

‎lib/matplotlib/tests/test_backend_macosx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def new_choose_save_file(title, directory, filename):
4646
assertmpl.rcParams["savefig.directory"]==f"{tmp_path}/test"
4747

4848

49+
@pytest.mark.backend('macosx')
4950
deftest_ipython():
5051
frommatplotlib.testingimportipython_in_subprocess
5152
ipython_in_subprocess("osx", {(8,24):"macosx", (7,0):"MacOSX"})

‎lib/matplotlib/tests/test_backend_qt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ def custom_handler(signum, frame):
374374
signal.signal(signal.SIGINT,original_handler)
375375

376376

377+
@pytest.mark.backend('QtAgg',skip_on_importerror=True)
377378
deftest_ipython():
378379
frommatplotlib.testingimportipython_in_subprocess
379380
ipython_in_subprocess("qt", {(8,24):"qtagg", (8,15):"QtAgg", (7,0):"Qt5Agg"})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp