mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 18:14:10 +00:00
Merge pull request #953 from willingc/covfix
Rename test class to stub class to allow pytest collection Closes #952
This commit is contained in:
13
.coveragerc
13
.coveragerc
@@ -1,4 +1,17 @@
|
||||
[run]
|
||||
branch = False
|
||||
omit =
|
||||
jupyterhub/tests/*
|
||||
jupyterhub/alembic/*
|
||||
|
||||
[report]
|
||||
exclude_lines =
|
||||
if self.debug:
|
||||
pragma: no cover
|
||||
raise NotImplementedError
|
||||
if __name__ == .__main__.:
|
||||
ignore_errors = True
|
||||
omit =
|
||||
jupyterhub/tests/*
|
||||
jupyterhub/alembic/*
|
||||
*/site-packages/*
|
||||
|
@@ -14,7 +14,7 @@ before_install:
|
||||
install:
|
||||
- pip install --pre -f travis-wheels/wheelhouse -r dev-requirements.txt .
|
||||
script:
|
||||
- travis_retry py.test --cov jupyterhub jupyterhub/tests -v
|
||||
- travis_retry py.test --cov=jupyterhub jupyterhub/tests -v
|
||||
after_success:
|
||||
- codecov
|
||||
matrix:
|
||||
|
@@ -234,7 +234,7 @@ class MockSingleUserServer(SingleUserNotebookApp):
|
||||
pass
|
||||
|
||||
|
||||
class TestSingleUserSpawner(MockSpawner):
|
||||
class StubSingleUserSpawner(MockSpawner):
|
||||
"""Spawner that starts a MockSingleUserServer in a thread."""
|
||||
_thread = None
|
||||
@gen.coroutine
|
||||
|
@@ -6,14 +6,14 @@ import sys
|
||||
import requests
|
||||
|
||||
import jupyterhub
|
||||
from .mocking import TestSingleUserSpawner, public_url
|
||||
from .mocking import StubSingleUserSpawner, public_url
|
||||
from ..utils import url_path_join
|
||||
|
||||
|
||||
def test_singleuser_auth(app, io_loop):
|
||||
# use TestSingleUserSpawner to launch a single-user app in a thread
|
||||
app.spawner_class = TestSingleUserSpawner
|
||||
app.tornado_settings['spawner_class'] = TestSingleUserSpawner
|
||||
# use StubSingleUserSpawner to launch a single-user app in a thread
|
||||
app.spawner_class = StubSingleUserSpawner
|
||||
app.tornado_settings['spawner_class'] = StubSingleUserSpawner
|
||||
|
||||
# login, start the server
|
||||
cookies = app.login_user('nandy')
|
||||
@@ -39,9 +39,9 @@ def test_singleuser_auth(app, io_loop):
|
||||
|
||||
|
||||
def test_disable_user_config(app, io_loop):
|
||||
# use TestSingleUserSpawner to launch a single-user app in a thread
|
||||
app.spawner_class = TestSingleUserSpawner
|
||||
app.tornado_settings['spawner_class'] = TestSingleUserSpawner
|
||||
# use StubSingleUserSpawner to launch a single-user app in a thread
|
||||
app.spawner_class = StubSingleUserSpawner
|
||||
app.tornado_settings['spawner_class'] = StubSingleUserSpawner
|
||||
# login, start the server
|
||||
cookies = app.login_user('nandy')
|
||||
user = app.users['nandy']
|
||||
|
Reference in New Issue
Block a user