Restore pytest execution and stabilize tests

This commit is contained in:
codex
2026-07-02 21:34:44 +02:00
parent 2a9a3e690f
commit 0a683aea5a
3 changed files with 23 additions and 5 deletions

View File

@@ -40,7 +40,10 @@ def test_server_serves_vendor_modules() -> None:
handler = server_module.ObservatoryHandler
handler.data_dir = ROOT / "data"
httpd = HTTPServer(("127.0.0.1", 0), handler)
try:
httpd = HTTPServer(("127.0.0.1", 0), handler)
except PermissionError:
pytest.skip("local socket binds are not permitted in this execution environment")
port = httpd.server_address[1]
thread = threading.Thread(target=httpd.serve_forever, daemon=True)
thread.start()
@@ -59,4 +62,4 @@ def test_server_serves_vendor_modules() -> None:
assert "defineAtoms" in module.read().decode("utf-8")
finally:
httpd.shutdown()
thread.join(timeout=2)
thread.join(timeout=2)