From f6f8c3f3aa65a1b525ac49d2c795672c36c3109e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 1 Apr 2022 19:34:29 -0500 Subject: [PATCH] Add explicit handling of warnings (#771) * add explicit handling of warnings * ignore warning on min version test * fix process shutdown * fix remaining warnings * fixup * add cleanup_suprocesses --- .github/workflows/python-tests.yml | 6 +++--- docs/source/operators/multiple-extensions.rst | 2 +- jupyter_server/pytest_plugin.py | 2 +- pyproject.toml | 8 ++++++++ tests/auth/test_authorizer.py | 3 +++ tests/extension/test_launch.py | 5 +++++ tests/extension/test_serverextension.py | 7 +++---- tests/services/kernelspecs/test_api.py | 6 ------ .../unix_sockets/test_serverapp_integration.py | 17 ++++++++++++----- 9 files changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 4919ffc96b..1491e21c60 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -33,8 +33,8 @@ jobs: - name: Run the tests if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }} run: | - args="-vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered --cov-fail-under 70" - python -m pytest $args || python -m pytest $args --lf + args="-vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered" + python -m pytest $args --cov-fail-under 70 || python -m pytest $args --lf - name: Run the tests on pypy and windows if: ${{ startsWith(matrix.python-version, 'pypy') || startsWith(matrix.os, 'windows') }} run: | @@ -78,7 +78,7 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1 - name: Run the unit tests run: | - pytest -vv || pytest -vv --lf + pytest -vv -W default || pytest -vv -W default --lf test_prereleases: name: Test Prereleases diff --git a/docs/source/operators/multiple-extensions.rst b/docs/source/operators/multiple-extensions.rst index eb3c10332e..192f221ac3 100644 --- a/docs/source/operators/multiple-extensions.rst +++ b/docs/source/operators/multiple-extensions.rst @@ -90,4 +90,4 @@ Extensions can also be enabled manually from the Jupyter Server entrypoint using .. code-block:: console - > jupyter server --ServerApp.jpserver_extensions='{"myextension":{"enabled": True}}' + > jupyter server --ServerApp.jpserver_extensions="myextension=True" diff --git a/jupyter_server/pytest_plugin.py b/jupyter_server/pytest_plugin.py index 68a071b03b..7b35795c63 100644 --- a/jupyter_server/pytest_plugin.py +++ b/jupyter_server/pytest_plugin.py @@ -415,7 +415,7 @@ def client_fetch(*parts, headers=None, params=None, **kwargs): @pytest.fixture def jp_kernelspecs(jp_data_dir): """Configures some sample kernelspecs in the Jupyter data directory.""" - spec_names = ["sample", "sample 2", "bad"] + spec_names = ["sample", "sample2", "bad"] for name in spec_names: sample_kernel_dir = jp_data_dir.joinpath("kernels", name) sample_kernel_dir.mkdir(parents=True) diff --git a/pyproject.toml b/pyproject.toml index 808d775749..93138976e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,14 @@ testpaths = [ timeout = 300 # Restore this setting to debug failures # timeout_method = "thread" +filterwarnings = [ + "error", + "ignore:There is no current event loop:DeprecationWarning", + "ignore:Passing a schema to Validator.iter_errors:DeprecationWarning", + "ignore:unclosed