#10098: Flaky doctest in sage/interfaces/expect.py
-----------------------+----------------------------------------------------
   Reporter:  mpatel   |       Owner:  mvngu   
       Type:  defect   |      Status:  new     
   Priority:  blocker  |   Milestone:  sage-4.6
  Component:  doctest  |    Keywords:          
     Author:           |    Upstream:  N/A     
   Reviewer:           |      Merged:          
Work_issues:           |  
-----------------------+----------------------------------------------------

Comment(by mpatel):

 Replying to [comment:6 mpatel]:
 > For the problem in the description, I suppose Sage tries to empty a
 temporary directory.  What if we wrap that in a `try-except` block?

 It's already wrapped in a such block.  From near the end of
 `sage.parallel.use_fork.p_iter_fork.__call__`:
 {{{
 #!python
        finally:

             # Clean up all temporary files.
             try:
                 for X in os.listdir(dir):
                     os.unlink(os.path.join(dir, X))
                 os.rmdir(dir)
             except OSError, msg:
                 if self.verbose:
                     print msg
 }}}

 Changing the doctest to
 {{{
 #!python
 @parallel(verbose=False)
 def f(n):
     return gap._local_tmpfile()

 L = [t[1] for t in f(range(5))]
 len(set(L))
 }}}
 should "fix" the problem.  This example is not intended to test
 `use_fork`, which has it's own tests, so we could justify doing this here.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10098#comment:9>
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