#20182: Automatic doctest for external softwares
-------------------------+-------------------------------------------------
       Reporter:  klee   |        Owner:
           Type:         |       Status:  new
  enhancement            |    Milestone:  sage-7.1
       Priority:  major  |   Resolution:
      Component:         |    Merged in:
  doctest framework      |    Reviewers:
       Keywords:         |  Work issues:
        Authors:         |       Commit:
  Kwankyu Lee            |  781796004587c55aaa385754f69498c1cecfea0d
Report Upstream:  N/A    |     Stopgaps:
         Branch:         |
  public/20182           |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by jhpalmieri):

 On my computer, doctesting the file `external.py` causes two windows to
 open up, showing the results from `view('2+3')`. Try to find another way
 to test whether latex is present and functional, maybe something like
 this:
 {{{
 diff --git a/src/sage/doctest/external.py b/src/sage/doctest/external.py
 index f05bc8d..463413a 100644
 --- a/src/sage/doctest/external.py
 +++ b/src/sage/doctest/external.py
 @@ -59,9 +59,14 @@ def has_latex():
          sage: has_latex() # random
          True
      """
 -    from sage.misc.latex import view
 +    from sage.misc.latex import _run_latex_, _latex_file_
 +    from sage.misc.temporary_file import tmp_filename
      try:
 -        view('2+3')
 +        f = tmp_filename(ext='.tex')
 +        O = open(f, 'w')
 +        O.write(_latex_file_('3'))
 +        O.close()
 +        _run_latex_(f)
          return True
      except Exception:
          return False
 }}}

 Also, you might consider adding `ImageMagick` (and in particular the
 `convert` command) to the set of external programs to be tested.

--
Ticket URL: <http://trac.sagemath.org/ticket/20182#comment:43>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to