mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-08 18:44: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]
|
[run]
|
||||||
|
branch = False
|
||||||
omit =
|
omit =
|
||||||
jupyterhub/tests/*
|
jupyterhub/tests/*
|
||||||
jupyterhub/alembic/*
|
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:
|
install:
|
||||||
- pip install --pre -f travis-wheels/wheelhouse -r dev-requirements.txt .
|
- pip install --pre -f travis-wheels/wheelhouse -r dev-requirements.txt .
|
||||||
script:
|
script:
|
||||||
- travis_retry py.test --cov jupyterhub jupyterhub/tests -v
|
- travis_retry py.test --cov=jupyterhub jupyterhub/tests -v
|
||||||
after_success:
|
after_success:
|
||||||
- codecov
|
- codecov
|
||||||
matrix:
|
matrix:
|
||||||
|
@@ -234,7 +234,7 @@ class MockSingleUserServer(SingleUserNotebookApp):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TestSingleUserSpawner(MockSpawner):
|
class StubSingleUserSpawner(MockSpawner):
|
||||||
"""Spawner that starts a MockSingleUserServer in a thread."""
|
"""Spawner that starts a MockSingleUserServer in a thread."""
|
||||||
_thread = None
|
_thread = None
|
||||||
@gen.coroutine
|
@gen.coroutine
|
||||||
|
@@ -6,14 +6,14 @@ import sys
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
import jupyterhub
|
import jupyterhub
|
||||||
from .mocking import TestSingleUserSpawner, public_url
|
from .mocking import StubSingleUserSpawner, public_url
|
||||||
from ..utils import url_path_join
|
from ..utils import url_path_join
|
||||||
|
|
||||||
|
|
||||||
def test_singleuser_auth(app, io_loop):
|
def test_singleuser_auth(app, io_loop):
|
||||||
# use TestSingleUserSpawner to launch a single-user app in a thread
|
# use StubSingleUserSpawner to launch a single-user app in a thread
|
||||||
app.spawner_class = TestSingleUserSpawner
|
app.spawner_class = StubSingleUserSpawner
|
||||||
app.tornado_settings['spawner_class'] = TestSingleUserSpawner
|
app.tornado_settings['spawner_class'] = StubSingleUserSpawner
|
||||||
|
|
||||||
# login, start the server
|
# login, start the server
|
||||||
cookies = app.login_user('nandy')
|
cookies = app.login_user('nandy')
|
||||||
@@ -39,9 +39,9 @@ def test_singleuser_auth(app, io_loop):
|
|||||||
|
|
||||||
|
|
||||||
def test_disable_user_config(app, io_loop):
|
def test_disable_user_config(app, io_loop):
|
||||||
# use TestSingleUserSpawner to launch a single-user app in a thread
|
# use StubSingleUserSpawner to launch a single-user app in a thread
|
||||||
app.spawner_class = TestSingleUserSpawner
|
app.spawner_class = StubSingleUserSpawner
|
||||||
app.tornado_settings['spawner_class'] = TestSingleUserSpawner
|
app.tornado_settings['spawner_class'] = StubSingleUserSpawner
|
||||||
# login, start the server
|
# login, start the server
|
||||||
cookies = app.login_user('nandy')
|
cookies = app.login_user('nandy')
|
||||||
user = app.users['nandy']
|
user = app.users['nandy']
|
||||||
|
Reference in New Issue
Block a user