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

Commit52579fa

Browse files
committed
TST: Avoid using os.devnull for path tests
On wasm, this file doesn't support seeking, which is sometimes necessarydepending on file type.
1 parentf1b6047 commit52579fa

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

‎lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
importdatetime
22
importdecimal
33
importio
4-
importos
54
frompathlibimportPath
65

76
importnumpyasnp
@@ -307,8 +306,8 @@ def test_text_urls_tex():
307306
assertannot.Rect[1]==decimal.Decimal('0.7')*72
308307

309308

310-
deftest_pdfpages_fspath():
311-
withPdfPages(Path(os.devnull))aspdf:
309+
deftest_pdfpages_fspath(tmp_path):
310+
withPdfPages(tmp_path/'unused.pdf')aspdf:
312311
pdf.savefig(plt.figure())
313312

314313

‎lib/matplotlib/tests/test_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ def test_imsave_rgba_origin(origin):
193193

194194

195195
@pytest.mark.parametrize("fmt", ["png","pdf","ps","eps","svg"])
196-
deftest_imsave_fspath(fmt):
197-
plt.imsave(Path(os.devnull),np.array([[0,1]]),format=fmt)
196+
deftest_imsave_fspath(fmt,tmp_path):
197+
plt.imsave(tmp_path/f'unused.{fmt}',np.array([[0,1]]),format=fmt)
198198

199199

200200
deftest_imsave_color_alpha():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp