mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 06:52:59 +00:00
fix some deprecation warnings in tests
Calling HasTraits(attr=value) doesn't work for non-traits 1. remove one redundant assignment for a non-trait 2. make one attribute a trait
This commit is contained in:
@@ -76,7 +76,7 @@ def app(request, io_loop, ssl_tmpdir):
|
|||||||
"""Mock a jupyterhub app for testing"""
|
"""Mock a jupyterhub app for testing"""
|
||||||
mocked_app = None
|
mocked_app = None
|
||||||
ssl_enabled = getattr(request.module, "ssl_enabled", False)
|
ssl_enabled = getattr(request.module, "ssl_enabled", False)
|
||||||
kwargs = dict(log_level=logging.DEBUG)
|
kwargs = dict()
|
||||||
if ssl_enabled:
|
if ssl_enabled:
|
||||||
kwargs.update(
|
kwargs.update(
|
||||||
dict(
|
dict(
|
||||||
|
@@ -40,7 +40,7 @@ from tornado import gen
|
|||||||
from tornado.concurrent import Future
|
from tornado.concurrent import Future
|
||||||
from tornado.ioloop import IOLoop
|
from tornado.ioloop import IOLoop
|
||||||
|
|
||||||
from traitlets import Bool, default
|
from traitlets import Bool, Dict, default
|
||||||
|
|
||||||
from ..app import JupyterHub
|
from ..app import JupyterHub
|
||||||
from ..auth import PAMAuthenticator
|
from ..auth import PAMAuthenticator
|
||||||
@@ -219,12 +219,15 @@ class MockPAMAuthenticator(PAMAuthenticator):
|
|||||||
class MockHub(JupyterHub):
|
class MockHub(JupyterHub):
|
||||||
"""Hub with various mock bits"""
|
"""Hub with various mock bits"""
|
||||||
|
|
||||||
|
# disable some inherited traits with hardcoded values
|
||||||
db_file = None
|
db_file = None
|
||||||
last_activity_interval = 2
|
last_activity_interval = 2
|
||||||
log_datefmt = '%M:%S'
|
log_datefmt = '%M:%S'
|
||||||
external_certs = None
|
|
||||||
log_level = 10
|
log_level = 10
|
||||||
|
|
||||||
|
# MockHub additional traits
|
||||||
|
external_certs = Dict()
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
if 'internal_certs_location' in kwargs:
|
if 'internal_certs_location' in kwargs:
|
||||||
cert_location = kwargs['internal_certs_location']
|
cert_location = kwargs['internal_certs_location']
|
||||||
|
Reference in New Issue
Block a user