mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Ensure that in-process test group doesn't create global IPython singleton.
Since the in-process group makes its own shells, it should avoid creating the global singleton.
This commit is contained in:
parent
e08873d7f6
commit
630e178616
@ -430,7 +430,7 @@ def make_runners(inc_slow=False):
|
||||
|
||||
# Packages to be tested via nose, that only depend on the stdlib
|
||||
nose_pkg_names = ['config', 'core', 'extensions', 'frontend', 'lib',
|
||||
'testing', 'utils', 'nbformat' ]
|
||||
'testing', 'utils', 'nbformat', 'inprocess' ]
|
||||
|
||||
if have['zmq']:
|
||||
nose_pkg_names.append('zmq')
|
||||
@ -491,8 +491,17 @@ def run_iptest():
|
||||
# use our plugin for doctesting. It will remove the standard doctest plugin
|
||||
# if it finds it enabled
|
||||
plugins = [IPythonDoctest(make_exclude()), KnownFailure()]
|
||||
# We need a global ipython running in this process
|
||||
globalipapp.start_ipython()
|
||||
|
||||
# We need a global ipython running in this process, but the special
|
||||
# in-process group spawns its own IPython kernels, so for *that* group we
|
||||
# must avoid also opening the global one (otherwise there's a conflict of
|
||||
# singletons). Ultimately the solution to this problem is to refactor our
|
||||
# assumptions about what needs to be a singleton and what doesn't (app
|
||||
# objects should, individual shells shouldn't). But for now, this
|
||||
# workaround allows the test suite for the inprocess module to complete.
|
||||
if not 'IPython.inprocess' in sys.argv:
|
||||
globalipapp.start_ipython()
|
||||
|
||||
# Now nose can run
|
||||
TestProgram(argv=argv, addplugins=plugins)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user