Merge pull request #1468 from jtyberg/allow-root

Allow root user to run tests.
pull/1515/head
Matthias Bussonnier 10 years ago
commit 2cbc322467

@ -2,7 +2,7 @@
# Another Docker container should inherit with `FROM jupyter/notebook`
# to run actual services.
#
# For opinionated stacks of ready-to-run Jupyter applications in Docker,
# For opinionated stacks of ready-to-run Jupyter applications in Docker,
# check out docker-stacks <https://github.com/jupyter/docker-stacks>
FROM jupyter/ubuntu_14_04_locale_fix
@ -109,4 +109,4 @@ WORKDIR /notebooks
EXPOSE 8888
ENTRYPOINT ["tini", "--"]
CMD ["jupyter", "notebook", "--no-browser"]
CMD ["jupyter", "notebook", "--no-browser", "--allow-root"]

@ -34,7 +34,7 @@ class TimeoutError(Exception):
class NotebookTestBase(TestCase):
"""A base class for tests that need a running notebook.
This create some empty config and runtime directories
and then starts the notebook server with them.
"""
@ -60,7 +60,7 @@ class NotebookTestBase(TestCase):
return
raise TimeoutError("The notebook server didn't start up correctly.")
@classmethod
def wait_until_dead(cls):
"""Wait for the server process to terminate after shutdown"""
@ -85,7 +85,7 @@ class NotebookTestBase(TestCase):
cls.data_dir = data_dir
cls.runtime_dir = TemporaryDirectory()
cls.notebook_dir = TemporaryDirectory()
started = Event()
def start_thread():
app = cls.notebook = NotebookApp(
@ -98,6 +98,7 @@ class NotebookTestBase(TestCase):
notebook_dir=cls.notebook_dir.name,
base_url=cls.url_prefix,
config=cls.config,
allow_root=True,
)
# don't register signal handler during tests
app.init_signal = lambda : None

@ -77,7 +77,7 @@ def test_nb_dir_root():
def test_generate_config():
with TemporaryDirectory() as td:
app = NotebookApp(config_dir=td)
app.initialize(['--generate-config'])
app.initialize(['--generate-config', '--allow-root'])
with nt.assert_raises(NoStart):
app.start()
assert os.path.exists(os.path.join(td, 'jupyter_notebook_config.py'))

Loading…
Cancel
Save