8000 STY: formatting and import sorting · matplotlib/matplotlib@3727a38 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3727a38

Browse files
committed
STY: formatting and import sorting
1 parent ec90d87 commit 3727a38

File tree

6 files changed

+9
-19
lines changed

6 files changed

+9
-19
lines changed

lib/matplotlib/tests/test_backend_nbagg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
from pathlib import Path
3-
43
from tempfile import TemporaryDirectory
54

65
import pytest

lib/matplotlib/tests/test_backend_webagg.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import sys
33
import pytest
4+
45
import matplotlib.backends.backend_webagg_core
56

67
from matplotlib.testing import subprocess_run_for_testing
@@ -24,9 +25,7 @@ def test_webagg_fallback(backend):
2425
+ "print(plt.get_backend());"
2526
f"assert '{backend}' == plt.get_backend().lower();"
2627
)
27-
subprocess_run_for_testing(
28-
[sys.executable, "-c", test_code], env=env, check=True
29-
)
28+
subprocess_run_for_testing([sys.executable, "-c", test_code], env=env, check=True)
3029

3130

3231
def test_webagg_core_no_toolbar():

lib/matplotlib/tests/test_determinism.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44

55
import os
6-
import subprocess
76
import sys
87

98
import pytest
@@ -135,5 +134,5 @@ def test_determinism_source_date_epoch(fmt, string):
135134
f"from matplotlib.tests.test_determinism import _save_figure; "
136135
f"_save_figure('', {fmt!r})"],
137136
env={**os.environ, "SOURCE_DATE_EPOCH": "946684800",
138-
"MPLBACKEND": "Agg"}, stdout=subprocess.PIPE, text=False).stdout
137+
"MPLBACKEND": "Agg"}, capture_output=True, text=False).stdout
139138
assert string in buf

lib/matplotlib/tests/test_font_manager.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,7 @@ def bad_idea(n):
277277
def test_fontcache_thread_safe():
278278
pytest.importorskip('threading')
279279

280-
proc = subprocess_run_helper(
281-
_test_threading,
282-
timeout=10
283-
)
284-
if proc.returncode:
285-
pytest.fail("The subprocess returned with non-zero exit status "
286-
f"{proc.returncode}.")
280+
subprocess_run_helper(_test_threading, timeout=10)
287281

288282

289283
def test_fontentry_dataclass():

lib/matplotlib/tests/test_matplotlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_importable_with__OO():
7474
"import matplotlib.cbook as cbook; "
7575
"import matplotlib.patches as mpatches"
7676
)
77-
cmd = [sys.executable, "-OO", "-c", program]
7877
subprocess_run_for_testing(
79-
cmd, env={**os.environ, "MPLBACKEND": ""}, check=True
78+
[sys.executable, "-OO", "-c", program],
79+
env={**os.environ, "MPLBACKEND": ""}, check=True
8080
)

lib/matplotlib/tests/test_texmanager.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import os
22
from pathlib import Path
33
import re
4-
54
import sys
65

7-
import matplotlib.pyplot as plt
8-
from matplotlib.texmanager import TexManager
9-
from matplotlib.testing._markers import needs_usetex
106
import pytest
117

8+
import matplotlib.pyplot as plt
129
from matplotlib.testing import subprocess_run_for_testing
10+
from matplotlib.testing._markers import needs_usetex
11+
from matplotlib.texmanager import TexManager
1312

1413

1514
def test_fontconfig_preamble():

0 commit comments

Comments
 (0)
0