mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-13 04:53:01 +00:00
avoid cleaning users when we are testing resume
This commit is contained in:
@@ -40,7 +40,7 @@ from tornado import gen
|
||||
from tornado.concurrent import Future
|
||||
from tornado.ioloop import IOLoop
|
||||
|
||||
from traitlets import default
|
||||
from traitlets import Bool, default
|
||||
|
||||
from ..app import JupyterHub
|
||||
from ..auth import PAMAuthenticator
|
||||
@@ -282,9 +282,12 @@ class MockHub(JupyterHub):
|
||||
self.db.expire(service)
|
||||
return super().init_services()
|
||||
|
||||
clean_users = Bool(True)
|
||||
|
||||
def init_db(self):
|
||||
"""Ensure we start with a clean user list"""
|
||||
super().init_db()
|
||||
if self.clean_users:
|
||||
for user in self.db.query(orm.User):
|
||||
self.db.delete(user)
|
||||
self.db.commit()
|
||||
|
@@ -206,7 +206,7 @@ def test_resume_spawners(tmpdir, request):
|
||||
ssl_enabled = getattr(request.module, "ssl_enabled", False)
|
||||
if ssl_enabled:
|
||||
kwargs['internal_certs_location'] = str(tmpdir)
|
||||
app = MockHub(**kwargs)
|
||||
app = MockHub(clean_users=False, **kwargs)
|
||||
app.config.ConfigurableHTTPProxy.should_start = False
|
||||
app.config.ConfigurableHTTPProxy.auth_token = 'unused'
|
||||
yield app.initialize([])
|
||||
|
Reference in New Issue
Block a user