#13928: Problematic file filter in skip() from sage-ptest
---------------------------------+------------------------------------------
       Reporter:  ncohen         |         Owner:  mvngu       
           Type:  defect         |        Status:  needs_review
       Priority:  major          |     Milestone:  sage-5.6    
      Component:  doctest        |    Resolution:              
       Keywords:                 |   Work issues:              
Report Upstream:  N/A            |     Reviewers:              
        Authors:  Nathann Cohen  |     Merged in:              
   Dependencies:                 |      Stopgaps:              
---------------------------------+------------------------------------------

Comment (by leif):

 Replying to [comment:23 jhpalmieri]:
 > This looks okay to me after some superficial testing. We should still
 fix the issue where if the number of files is zero, it exits with a stupid
 error message. One possible fix is the first patch in [comment:11].
 Another option:
 > {{{
 > #!diff
 > diff --git a/sage-ptest b/sage-ptest
 > --- a/sage-ptest
 > +++ b/sage-ptest
 > @@ -429,6 +429,11 @@ for gr in range(0,numglobaliteration):
 >      interrupt = False
 >
 >      numthreads = min(numthreads, len(files))  # don't use more threads
 than files
 > +    if len(files) == 0:
 > +        print """
 > +Warning: no files to test!
 > +"""
 > +        sys.exit(0)
 >
 >      if len(files) == 1:
 >          file_str = "1 file"
 > }}}

 I prefer the latter.  Although it should still inform the user how long it
 took to doctest 0 files, similar to what `sage -b` does ("Time to execute
 0 commands ...").

 No, seriously, a warning would IMHO only make sense if we print it for
 every ''specified'' directory that didn't contain files to test.  (If no
 files remain at all, it's obvious that no file got tested, and from a
 script one would presumably just test the exit status, which [in what you
 propose] is 0 anyway.)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13928#comment:24>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to