Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/sage/env.py: canonicalize paths in a test #38826

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/sage/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@

sage: env = {k:v for (k,v) in os.environ.items() if not k.startswith("SAGE_")}
sage: from subprocess import check_output
sage: environment = "sage.all"
sage: cmd = f"from {environment} import SAGE_ROOT, SAGE_LOCAL; print((SAGE_ROOT, SAGE_LOCAL))"
sage: module_name = "sage.all" # hide .all import from the linter
sage: cmd = f"from {module_name} import SAGE_ROOT, SAGE_LOCAL;"
sage: cmd += "from os.path import samefile;"
sage: cmd += f"s1 = samefile(SAGE_ROOT, '{SAGE_ROOT}');"
sage: cmd += f"s2 = samefile(SAGE_LOCAL, '{SAGE_LOCAL}');"
sage: cmd += "print(s1 and s2);"
sage: out = check_output([sys.executable, "-c", cmd], env=env).decode().strip() # long time
sage: out == repr((SAGE_ROOT, SAGE_LOCAL)) # long time
sage: out == "True" # long time
True

AUTHORS:
Expand Down
Loading