8000 MNT: simplify and correct docs in tk test decorator · matplotlib/matplotlib@3f14f74 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f14f74

Browse files
committed
MNT: simplify and correct docs in tk test decorator
1 parent 06eed19 commit 3f14f74

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/matplotlib/tests/test_backend_tk.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ def _isolated_tk_test(success_count, func=None):
2020
2121
TkAgg tests seem to have interactions between tests, so isolate each test
2222
in a subprocess. See GH#18261
23-
24-
The decorated function must be fully self-contained, and thus perform
25-
all the imports it needs.
2623
"""
2724

2825
if func is None:
2926
return functools.partial(_isolated_tk_test, success_count)
3027

28+
if "MPL_TEST_ESCAPE_HATCH" in os.environ:
29+
return func
30+
3131
@functools.wraps(func)
3232
def test_func():
3333
if (sys.platform == "linux" and
@@ -53,10 +53,8 @@ def test_func():
5353
assert not [line for line in proc.stderr.splitlines()
5454
if "OpenGL" not in line]
5555
assert proc.stdout.count("success") == success_count
56-
if "MPL_TEST_ESCAPE_HATCH" in os.environ:
57-
return func
58-
else:
59-
return test_func
56+
57+
return test_func
6058

6159

6260
@_isolated_tk_test(success_count=6) # len(bad_boxes)

0 commit comments

Comments
 (0)
0