Ticket #5902 (closed enhancement: fixed)

Opened 16 months ago

Last modified 14 months ago

[with patch, positive review] Try SAGE_ROOT as base of argument to "sage -t"

Reported by: tabbott Owned by: mhansen
Priority: minor Milestone: sage-4.1
Component: doctest Keywords:
Cc: Author(s): Tim Abbott
Report Upstream: Reviewer(s): Mike Hansen
Merged in: sage-4.1.alpha3 Work issues:

Description

Running

sage -t devel/sage/sage/rings/polynomial/pbori.pyx

seems to not work for me sometimes when the current working directory is not SAGE_ROOT. I don't really understand what is going wrong here, since there is a "cd" in $SAGE_ROOT/sage, but I've heard other people complain about issues with this.

The attached patch caused the problems to go away for me.

Attachments

sage_scripts-sage-test-path.patch Download (0.8 KB) - added by tabbott 16 months ago.

Change History

Changed 16 months ago by tabbott

Changed 15 months ago by mhansen

  • owner changed from mabshoff to mhansen
  • status changed from new to assigned
  • summary changed from [with patch, needs review] Try SAGE_ROOT as base of argument to "sage -t" to [with patch, positive review] Try SAGE_ROOT as base of argument to "sage -t"

Looks good to me!

Changed 15 months ago by mhansen

  • reviewer set to Mike Hansen
  • author set to Tim Abbott

Changed 15 months ago by was

Running sage -t devel/sage/sage/rings/polynomial/pbori.pyx seems to not work for me sometimes when the current working directory is not SAGE_ROOT.

It should not work. "sage -t" is supposed to take the path to a file. If you're not in SAGE_ROOT, then devel/sage/sage/rings/polynomial/pbori.pyx is not a file. It's like with any other unix command. E.g., you wouldn't expect

cat devel/sage/sage/rings/polynomial/pbori.pyx

to magically work if you're not in SAGE_ROOT.

Note that Mike Hansen just gave this a positive review. I strongly disagree.

Changed 15 months ago by tabbott

Hi William,

My motivation for this change was that when you run "sage -testall", for each test it prints out what it is running as

sage -t devel/sage/sage/rings/polynomial/pbori.py

since $SAGE_ROOT/sage changes directory to SAGE_ROOT before proceeding.

So that if you copy-and-paste that output from "sage -testall" to run the test a second time, it doesn't work.

Changed 14 months ago by boothby

  • status changed from assigned to closed
  • resolution set to fixed
  • merged set to sage-4.1.alpha2

Changed 14 months ago by rlm

  • merged changed from sage-4.1.alpha2 to sage-4.1.alpha3
Note: See TracTickets for help on using tickets.