diff --git a/.coveragerc b/.coveragerc index 891ddfca..bdafbdb0 100644 --- a/.coveragerc +++ b/.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/* diff --git a/.travis.yml b/.travis.yml index 08470509..db4b0d89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/jupyterhub/tests/mocking.py b/jupyterhub/tests/mocking.py index 0dabff23..69b21c8d 100644 --- a/jupyterhub/tests/mocking.py +++ b/jupyterhub/tests/mocking.py @@ -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 diff --git a/jupyterhub/tests/test_singleuser.py b/jupyterhub/tests/test_singleuser.py index a3054d3d..cede2e70 100644 --- a/jupyterhub/tests/test_singleuser.py +++ b/jupyterhub/tests/test_singleuser.py @@ -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']