Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Only add sagenb globals if actually testing a sagenb file
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer committed Jan 8, 2014
1 parent 4b2c470 commit 214bf49
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/sage/doctest/forker.py
Expand Up @@ -2068,7 +2068,6 @@ def __call__(self, options, outtmpfile=None, msgfile=None, result_queue=None):
try:
file = self.source.path
basename = self.source.basename
import sage.all_cmdline
runner = SageDocTestRunner(
SageOutputChecker(),
verbose=options.verbose,
Expand All @@ -2081,11 +2080,10 @@ def __call__(self, options, outtmpfile=None, msgfile=None, result_queue=None):
results = DictAsObject(dict(walltime=[],cputime=[],err=None))
for it in range(N):
# Make the right set of globals available to doctests
if options.sagenb:
import sage.all_notebook
sage_all = sage.all_notebook
if basename.startswith("sagenb."):
import sage.all_notebook as sage_all
else:
sage_all = sage.all_cmdline
import sage.all_cmdline as sage_all
sage_namespace = RecordingDict(sage_all.__dict__)
sage_namespace['__name__'] = '__main__'
sage_namespace['__package__'] = None
Expand Down

0 comments on commit 214bf49

Please sign in to comment.