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

Commit86c0883

Browse files
authored
Merge pull request#26542 from QuLogic/kill-webagg-subproc
TST: Ensure test_webagg subprocess is terminated
2 parents6b0f313 +d598ecb commit86c0883

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

‎lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -477,24 +477,27 @@ def test_webagg():
477477
inspect.getsource(_test_interactive_impl)
478478
+"\n_test_interactive_impl()","{}"],
479479
env={**os.environ,"MPLBACKEND":"webagg","SOURCE_DATE_EPOCH":"0"})
480-
url="http://{}:{}".format(
481-
mpl.rcParams["webagg.address"],mpl.rcParams["webagg.port"])
480+
url=f'http://{mpl.rcParams["webagg.address"]}:{mpl.rcParams["webagg.port"]}'
482481
timeout=time.perf_counter()+_test_timeout
483-
whileTrue:
484-
try:
485-
retcode=proc.poll()
486-
# check that the subprocess for the server is not dead
487-
assertretcodeisNone
488-
conn=urllib.request.urlopen(url)
489-
break
490-
excepturllib.error.URLError:
491-
iftime.perf_counter()>timeout:
492-
pytest.fail("Failed to connect to the webagg server.")
493-
else:
494-
continue
495-
conn.close()
496-
proc.send_signal(signal.SIGINT)
497-
assertproc.wait(timeout=_test_timeout)==0
482+
try:
483+
whileTrue:
484+
try:
485+
retcode=proc.poll()
486+
# check that the subprocess for the server is not dead
487+
assertretcodeisNone
488+
conn=urllib.request.urlopen(url)
489+
break
490+
excepturllib.error.URLError:
491+
iftime.perf_counter()>timeout:
492+
pytest.fail("Failed to connect to the webagg server.")
493+
else:
494+
continue
495+
conn.close()
496+
proc.send_signal(signal.SIGINT)
497+
assertproc.wait(timeout=_test_timeout)==0
498+
finally:
499+
ifproc.poll()isNone:
500+
proc.kill()
498501

499502

500503
def_lazy_headless():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp