-
-
Notifications
You must be signed in to change notification settings - Fork 679
Closed
Milestone
Description
We prepare the Sage doctesting module for running in environments where sage.all is not available (#29705).
- An explicit import in
sage.doctest.parsing:
# We need to import from sage.all to avoid circular imports.
from sage.all import RealIntervalField
RIFtol = RealIntervalField(1044)
- We make the global environment for tests customizable in
sage.doctest.forker: ininit_sage:
import sage.repl.ipython_kernel.all_jupyter
and again in DocTestTask._run:
# Import Jupyter globals to doctest the Jupyter
# implementation of widgets and interacts
import sage.repl.ipython_kernel.all_jupyter as sage_all
... which is
"""
All imports for Jupyter
"""
from sage.all_cmdline import *
from .widgets_sagenb import (input_box, text_control, slider,
range_slider, checkbox, selector, input_grid, color_selector)
from .interact import interact
This is exposed by the new sage-runtest option --environment.
For example, #29865 defines modules such as sage.all__sage_objects. We would invoke sage -t --environment=sage.all__sage_objects to test against this global environment.
- We ignore errors importing
sage.interfaces.
Depends on #29940
CC: @tscrim @fchapoton @orlitzky @kliem @kiwifb
Component: refactoring
Author: Matthias Koeppe
Branch/Commit: 2a602df
Reviewer: Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/29922