()
| 482 | reason="this test fails an azure for unknown reasons") |
| 483 | @pytest.mark.skipif(sys.platform == "win32", reason="Cannot send SIGINT on Windows.") |
| 484 | def test_webagg(): |
| 485 | pytest.importorskip("tornado") |
| 486 | source = (inspect.getsource(_test_interactive_impl) + |
| 487 | "\n_test_interactive_impl()") |
| 488 | rc = '{"backend": "webagg"}' |
| 489 | with _WaitForStringPopen([sys.executable, "-c", source, rc]) as proc: |
| 490 | try: |
| 491 | buf = proc.wait_for('Press Ctrl+C') |
| 492 | url = re.search(r'visit (https?:\/\/\S+)', buf).group(1) |
| 493 | timeout = time.perf_counter() + _test_timeout |
| 494 | while True: |
| 495 | try: |
| 496 | retcode = proc.poll() |
| 497 | # check that the subprocess for the server is not dead |
| 498 | assert retcode is None |
| 499 | with urllib.request.urlopen(url): |
| 500 | # Do nothing; we've just confirmed that we can connect. |
| 501 | break |
| 502 | except urllib.error.URLError: |
| 503 | if time.perf_counter() > timeout: |
| 504 | pytest.fail("Failed to connect to the webagg server.") |
| 505 | else: |
| 506 | continue |
| 507 | proc.send_signal(signal.SIGINT) |
| 508 | assert proc.wait(timeout=_test_timeout) == 0 |
| 509 | finally: |
| 510 | if proc.poll() is None: |
| 511 | proc.kill() |
| 512 | |
| 513 | |
| 514 | def _lazy_headless(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…