diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 496ff75..f9cc628 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,12 @@ jobs: steps: - uses: actions/checkout@v3 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Run the tests on pypy + if: ${{ startsWith(matrix.python-version, 'pypy') }} + run: | + hatch run test:nowarn || hatch run test:nowarn --lf - name: Run the tests + if: ${{ !startsWith(matrix.python-version, 'pypy') }} run: hatch run cov:test || hatch run test:test --lf - name: Coverage run: | diff --git a/pytest_jupyter/jupyter_server.py b/pytest_jupyter/jupyter_server.py index 81156c6..f354661 100644 --- a/pytest_jupyter/jupyter_server.py +++ b/pytest_jupyter/jupyter_server.py @@ -67,7 +67,10 @@ async def get_server(): server.stop() if hasattr(server, "close_all_connections"): - io_loop.run_sync(server.close_all_connections) + try: + io_loop.run_sync(server.close_all_connections) + except TimeoutError: + pass http_server_port[0].close() diff --git a/tests/test_jupyter_server.py b/tests/test_jupyter_server.py index 60542f1..dc48e6e 100644 --- a/tests/test_jupyter_server.py +++ b/tests/test_jupyter_server.py @@ -2,6 +2,7 @@ import os from unittest.mock import MagicMock +import pytest from jupyter_server.auth import Authorizer from jupyter_server.serverapp import ServerApp from tornado.websocket import WebSocketHandler @@ -13,6 +14,10 @@ async def test_serverapp(jp_serverapp): assert isinstance(jp_serverapp, ServerApp) +def test_skip(jp_serverapp): + pytest.skip("Forcing a skip") + + async def test_get_api_spec(jp_fetch): response = await jp_fetch("api", "spec.yaml", method="GET") assert response.code == 200