-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #29922: sage.doctest: Make imports more specific; make global en…
…vironment for tests customizable We prepare the Sage doctesting module for running in environments where `sage.all` is not available (#29705). 1. 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) }}} 2. We make the global environment for tests customizable in `sage.doctest.forker`: in `init_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. 3. We ignore errors importing `sage.interfaces`. URL: https://trac.sagemath.org/29922 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Jonathan Kliem
- Loading branch information
Showing
6 changed files
with
88 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters