diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 29994b25..6a4c4d15 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/dev-requirements.txt b/dev-requirements.txt index 079eb6ca..af19c570 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -5,3 +5,4 @@ pyflakes pytest>=3.6 pytest-asyncio pytest-cov +sqlalchemy==1.* diff --git a/requirements.txt b/requirements.txt index e925b825..0cd708bb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ docker escapism -jupyterhub>=1.0 +jupyterhub>=2.0 +pytest-jupyterhub @ git+https://github.com/jupyterhub/pytest-jupyterhub.git@main diff --git a/setup.py b/setup.py index cd4e5968..e43bf428 100644 --- a/setup.py +++ b/setup.py @@ -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, }, diff --git a/tests/conftest.py b/tests/conftest.py index c792bc88..f2b0d807 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 @@ -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"): @@ -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