Skip to content

Commit

Permalink
skip tests in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer committed Jan 21, 2022
1 parent a71d35b commit 18f5ed3
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions jupyter_server/tests/services/sessions/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import shutil
import time

import jupyter_client
import pytest
import tornado
from jupyter_client.ioloop import AsyncIOLoopKernelManager
Expand Down Expand Up @@ -36,22 +37,42 @@ def _default_kernel_manager_class(self):
return "jupyter_server.tests.services.sessions.test_api.NewPortsKernelManager"


@pytest.fixture(
params=["MappingKernelManager", "AsyncMappingKernelManager", "NewPortsMappingKernelManager"]
)
def jp_argv(request):
if request.param == "NewPortsMappingKernelManager":
extra = []
if hasattr(AsyncMappingKernelManager, "use_pending_kernels"):
extra = ["--AsyncMappingKernelManager.use_pending_kernels=True"]
return [
"--ServerApp.kernel_manager_class=jupyter_server.tests.services.sessions.test_api."
+ request.param
] + extra
return [
"--ServerApp.kernel_manager_class=jupyter_server.services.kernels.kernelmanager."
+ request.param
]
configs = [
{
"ServerApp": {
"kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.MappingKernelManager"
}
},
{
"ServerApp": {
"kernel_manager_class": "jupyter_server.services.kernels.kernelmanager.AsyncMappingKernelManager"
}
},
{
"ServerApp": {
"kernel_manager_class": "jupyter_server.tests.services.sessions.test_api.NewPortsMappingKernelManager"
}
},
]


# Pending kernels was released in Jupyter Client 7.1
# It is currently broken on Windows (Jan 2022). When fixed, we can remove the Windows check.
# See https://github.com/jupyter-server/jupyter_server/issues/672
if os.name != "nt" and jupyter_client._version.version_info >= (7, 1):
# Add a pending kernels condition
c = {
"ServerApp": {
"kernel_manager_class": "jupyter_server.tests.services.sessions.test_api.NewPortsMappingKernelManager"
},
"AsyncMappingKernelManager": {"use_pending_kernels": True},
}
configs.append(c)


@pytest.fixture(params=configs)
def jp_server_config(request):
return request.param


class SessionClient:
Expand Down

0 comments on commit 18f5ed3

Please sign in to comment.