Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warnings for tests #709

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/python-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
- name: Install the Python dependencies
run: |
pip install -e ".[test]" codecov
pip install git+https://github.com/blink1073/jupyter_client@filter-warnings
- name: List installed packages
run: |
pip freeze
Expand Down Expand Up @@ -86,7 +87,9 @@ jobs:
- name: Install miniumum versions
uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
- name: Run the unit tests
run: pytest -vv
run: |
pip install git+https://github.com/blink1073/jupyter_client@filter-warnings
pytest -vv

test_prereleases:
name: Test Prereleases
Expand All @@ -105,6 +108,7 @@ jobs:
pip check
- name: Run the tests
run: |
pip install git+https://github.com/blink1073/jupyter_client@filter-warnings
pytest -vv

make_sdist:
Expand Down
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,30 @@ testpaths = [
]
timeout = 300
timeout_method = "thread"
filterwarnings= [
# Fail on warnings
"error",

# Workarounds for https://github.com/pytest-dev/pytest-asyncio/issues/77
"ignore:unclosed <socket.socket:ResourceWarning",
"ignore:unclosed event loop:ResourceWarning",

# Workaround for https://github.com/tornadoweb/tornado/issues/3106
# (To be fixed in Tornado 6.2)
"ignore:There is no current event loop:DeprecationWarning:tornado",

# Workaround for distutils.Version used in ipykernel
"ignore:The distutils package is deprecated and slated for removal:DeprecationWarning:ipykernel",

# ZMQ uses Future internally, which raises a DeprecationWarning
# When there is no loop running.
# We could eventually find a way to make sure these are only created
# when there is a running event loop.
"ignore:There is no current event loop:DeprecationWarning:zmq",

# Workaround for https://github.com/jupyter/nbformat/issues/232
"ignore:Passing a schema:DeprecationWarning:nbformat",
]

[tool.jupyter-releaser]
skip = ["check-links"]
Expand Down
8 changes: 4 additions & 4 deletions tests/services/kernels/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

@pytest.fixture
def pending_kernel_is_ready(jp_serverapp):
async def _(kernel_id):
async def _(kernel_id, attr="ready"):
km = jp_serverapp.kernel_manager
if getattr(km, "use_pending_kernels", False):
kernel = km.get_kernel(kernel_id)
if getattr(kernel, "ready"):
await kernel.ready
if getattr(kernel, attr):
await getattr(kernel, attr)

return _

Expand Down Expand Up @@ -193,7 +193,7 @@ async def test_kernel_handler(jp_fetch, jp_cleanup_subprocesses, pending_kernel_

# Get list of kernels
try:
await pending_kernel_is_ready(kernel_id)
await pending_kernel_is_ready(kernel_id, "shutdown_ready")
# If the kernel is already deleted, no need to await.
except tornado.web.HTTPError:
pass
Expand Down