#20322: use SAGE_BANNER to propose a bare banner with no utf8
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  chapoton               |       Status:  positive_review
           Type:         |    Milestone:  sage-7.2
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:  user   |    Reviewers:  Jeroen Demeyer
  interface              |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  5b87f1aca7a38d0c5ef80b8e12b16822039a7360
  Frédéric Chapoton      |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/jdemeyer/20322       |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by embray):

 I still think that if a test is expecting something particular about the
 environment that it should set that environment for the test.  For example
 something like
 {{{
 diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py
 index 534436d..1d0395e 100644
 --- a/src/sage/tests/cmdline.py
 +++ b/src/sage/tests/cmdline.py
 @@ -57,7 +57,7 @@ from subprocess import *
  import os, select


 -def test_executable(args, input="", timeout=100.0, **kwds):
 +def test_executable(args, input="", timeout=100.0, env={}, **kwds):
      r"""
      Run the program defined by ``args`` using the string ``input`` on
      the standard input.
 @@ -102,7 +102,7 @@ def test_executable(args, input="", timeout=100.0,
 **kwds):

      Run Sage itself with various options::

 -        sage: (out, err, ret) = test_executable(["sage"])
 +        sage: (out, err, ret) = test_executable(["sage"],
 env={'SAGE_BANNER': '
          sage: out.find(version()) >= 0
          True
          sage: err
 @@ -110,7 +110,7 @@ def test_executable(args, input="", timeout=100.0,
 **kwds):
 ...skipping...
 +        sage: (out, err, ret) = test_executable(["sage", "-q"], "3^33\n",
 env={
          sage: out.find(version()) >= 0
          False
          sage: out.find("5559060566555523") >= 0
 @@ -489,7 +489,7 @@ def test_executable(args, input="", timeout=100.0,
 **kwds):
          ....:         os.open(os.ctermid(), os.O_RDONLY)
          ....:         return True
          ....:     except OSError:
 -        ....:         return False
 +        ....:         return False
          sage: (out, err, ret) = test_executable(["sage", "--ecl"], "(*
 12345 54
          sage: out.find("Embeddable Common-Lisp") >= 0
          True
 @@ -728,6 +728,9 @@ def test_executable(args, input="", timeout=100.0,
 **kwds):
          del pexpect_env["TERM"]
      except KeyError:
          pass
 +
 +    pexpect_env.update(env)
 +
      p = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE,
 env=pexpect_env, **kw
      if input:
          p.stdin.write(input)
 }}}

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