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

Handle jupyter core warning #58

Merged
merged 2 commits into from
Nov 11, 2022
Merged
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
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ filterwarnings = [
"module:make_current is deprecated:DeprecationWarning",
"module:clear_current is deprecated:DeprecationWarning",
"module:There is no current event loop:DeprecationWarning",
# From juypter core
"module:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning",
]

[tool.mypy]
Expand Down
3 changes: 0 additions & 3 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ async def test_authorized_requests(
io_loop,
send_request,
jp_serverapp,
jp_cleanup_subprocesses,
method,
url,
body,
Expand Down Expand Up @@ -156,5 +155,3 @@ async def test_authorized_requests(
continue
assert code in expected_codes
break

await jp_cleanup_subprocesses()
20 changes: 6 additions & 14 deletions tests/test_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def test_no_terminals(jp_fetch):
assert len(data) == 0


async def test_terminal_create(jp_fetch, jp_cleanup_subprocesses):
async def test_terminal_create(jp_fetch):
resp = await jp_fetch(
"api",
"terminals",
Expand All @@ -84,10 +84,9 @@ async def test_terminal_create(jp_fetch, jp_cleanup_subprocesses):
del data[0]["last_activity"]
del term["last_activity"]
assert data[0] == term
await jp_cleanup_subprocesses()


async def test_terminal_create_with_kwargs(jp_fetch, terminal_path, jp_cleanup_subprocesses):
async def test_terminal_create_with_kwargs(jp_fetch, terminal_path):
resp_create = await jp_fetch(
"api",
"terminals",
Expand All @@ -110,12 +109,9 @@ async def test_terminal_create_with_kwargs(jp_fetch, terminal_path, jp_cleanup_s
data = json.loads(resp_get.body.decode())

assert data["name"] == term_name
await jp_cleanup_subprocesses()


async def test_terminal_create_with_cwd(
jp_fetch, jp_ws_fetch, terminal_path, jp_cleanup_subprocesses
):
async def test_terminal_create_with_cwd(jp_fetch, jp_ws_fetch, terminal_path):
resp = await jp_fetch(
"api",
"terminals",
Expand Down Expand Up @@ -153,11 +149,10 @@ async def test_terminal_create_with_cwd(
ws.close()

assert os.path.basename(terminal_path) in message_stdout
await jp_cleanup_subprocesses()


async def test_terminal_create_with_relative_cwd(
jp_fetch, jp_ws_fetch, jp_root_dir, terminal_root_dir, jp_cleanup_subprocesses
jp_fetch, jp_ws_fetch, jp_root_dir, terminal_root_dir
):
resp = await jp_fetch(
"api",
Expand Down Expand Up @@ -197,10 +192,9 @@ async def test_terminal_create_with_relative_cwd(

expected = terminal_root_dir.name if sys.platform == "win32" else str(terminal_root_dir)
assert expected in message_stdout
await jp_cleanup_subprocesses()


async def test_terminal_create_with_bad_cwd(jp_fetch, jp_ws_fetch, jp_cleanup_subprocesses):
async def test_terminal_create_with_bad_cwd(jp_fetch, jp_ws_fetch):
non_existing_path = "/tmp/path/to/nowhere"
resp = await jp_fetch(
"api",
Expand Down Expand Up @@ -239,7 +233,6 @@ async def test_terminal_create_with_bad_cwd(jp_fetch, jp_ws_fetch, jp_cleanup_su
ws.close()

assert non_existing_path not in message_stdout
await jp_cleanup_subprocesses()


async def test_culling_config(jp_configurable_serverapp):
Expand All @@ -252,7 +245,7 @@ async def test_culling_config(jp_configurable_serverapp):


@pytest.mark.skipif(os.name == "nt", reason="Not currently working on Windows")
async def test_culling(jp_fetch, jp_cleanup_subprocesses):
async def test_culling(jp_fetch):
# POST request
resp = await jp_fetch(
"api",
Expand Down Expand Up @@ -282,4 +275,3 @@ async def test_culling(jp_fetch, jp_cleanup_subprocesses):
await asyncio.sleep(1)

assert culled
await jp_cleanup_subprocesses()