Skip to content
Draft
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: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
include:
- python: 3.8
test: internal-ssl
- python: 3.7
jupyterhub: 1.5
- python: 3.8
jupyterhub: 2.0
- python: 3.9
Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pyflakes
pytest>=3.6
pytest-asyncio
pytest-cov
sqlalchemy==1.*
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docker
escapism
jupyterhub>=1.0
jupyterhub>=2.0
pytest-jupyterhub @ git+https://github.com/jupyterhub/pytest-jupyterhub.git@main
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def run(self):
'docker-swarm = dockerspawner:SwarmSpawner',
],
},
python_requires=">=3.6",
python_requires=">=3.8",
cmdclass={
'bdist_egg': bdist_egg if 'bdist_egg' in sys.argv else bdist_egg_disabled,
},
Expand Down
20 changes: 11 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
from docker import from_env as docker_from_env
from docker.errors import APIError
from jupyterhub import version_info as jh_version_info
from jupyterhub.tests.conftest import app as jupyterhub_app # noqa: F401
from jupyterhub.tests.conftest import event_loop # noqa: F401
from jupyterhub.tests.conftest import io_loop # noqa: F401
from jupyterhub.tests.conftest import ssl_tmpdir # noqa: F401
from jupyterhub.tests.mocking import MockHub

from dockerspawner import DockerSpawner, SwarmSpawner, SystemUserSpawner
Expand All @@ -23,6 +19,10 @@

# make Hub connectable from docker by default
# do this here because the `app` fixture has already loaded configuration

# Load pytest plugins
pytest_plugins = "jupyterhub-spawners-plugin"

MockHub.hub_ip = "0.0.0.0"

if os.environ.get("HUB_CONNECT_IP"):
Expand Down Expand Up @@ -57,13 +57,15 @@ def pytest_collection_modifyitems(items):


@pytest.fixture
def app(jupyterhub_app):
app = jupyterhub_app
app.config.DockerSpawner.prefix = "dockerspawner-test"
# If it's a prerelease e.g. (2, 0, 0, 'rc4', '') use full tag
async def app(hub_app):
config = {"Dockerspawner": {"prefix": "dockerspawner-test"}}

if len(jh_version_info) > 3 and jh_version_info[3]:
tag = jupyterhub.__version__
app.config.DockerSpawner.image = f"jupyterhub/singleuser:{tag}"
config["Dockerspawner"]["image"] = f"jupyterhub/singleuser:{tag}"

app = await hub_app(config=config)

return app


Expand Down