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

Commit 8f6323e

Browse files
author
Matthias Koeppe
committed
src/sage/env.py: Fix up doctest on starting sage without SAGE_* variables
1 parent 057a66b commit 8f6323e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/sage/env.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
66
- \R. Andrew Ohana (2012): Initial version.
77
8-
Verify that Sage can be started without any ``SAGE_`` environment
9-
variables::
8+
Verify that importing ``sage.all`` works in Sage's Python without any ``SAGE_``
9+
environment variables, and has the same ``SAGE_ROOT`` and ``SAGE_LOCAL``::
1010
1111
sage: env = {k:v for (k,v) in os.environ.items() if not k.startswith("SAGE_")}
12-
sage: import subprocess
13-
sage: cmd = "from sage.all import SAGE_ROOT; print(SAGE_ROOT)"
14-
sage: res = subprocess.call([sys.executable, "-c", cmd], env=env) # long time
15-
None
12+
sage: from subprocess import check_output
13+
sage: cmd = "from sage.all import SAGE_ROOT, SAGE_LOCAL; print((SAGE_ROOT, SAGE_LOCAL))"
14+
sage: out = check_output([sys.executable, "-c", cmd], env=env).decode().strip() # long time
15+
sage: out == repr((SAGE_ROOT, SAGE_LOCAL)) # long time
16+
True
1617
"""
1718

1819
# ****************************************************************************

0 commit comments

Comments
 (0)