[pypy-commit] pypy default: test for irc topic message only on release versions

mattip noreply at buildbot.pypy.org
Tue May 6 19:03:18 CEST 2014


Author: mattip <matti.picus at gmail.com>
Branch: 
Changeset: r71337:10affda0b314
Date: 2014-05-06 20:00 +0300
http://bitbucket.org/pypy/pypy/changeset/10affda0b314/

Log:	test for irc topic message only on release versions

diff --git a/lib_pypy/_pypy_interact.py b/lib_pypy/_pypy_interact.py
--- a/lib_pypy/_pypy_interact.py
+++ b/lib_pypy/_pypy_interact.py
@@ -3,6 +3,8 @@
 import sys
 import os
 
+irc_header = "And now for something completely different"
+
 
 def interactive_console(mainmodule=None, quiet=False):
     # set sys.{ps1,ps2} just before invoking the interactive interpreter. This
@@ -15,8 +17,7 @@
     if not quiet:
         try:
             from _pypy_irc_topic import some_topic
-            text = "And now for something completely different: ``%s''" % (
-                some_topic(),)
+            text = "%s: ``%s''" % ( irc_header, some_topic())
             while len(text) >= 80:
                 i = text[:80].rfind(' ')
                 print(text[:i])
diff --git a/pypy/interpreter/test/test_app_main.py b/pypy/interpreter/test/test_app_main.py
--- a/pypy/interpreter/test/test_app_main.py
+++ b/pypy/interpreter/test/test_app_main.py
@@ -7,6 +7,11 @@
 from rpython.tool.udir import udir
 from contextlib import contextmanager
 from pypy.conftest import pypydir
+from pypy.module.sys.version import PYPY_VERSION
+from lib_pypy._pypy_interact import irc_header
+
+is_release = PYPY_VERSION[3] == "final"
+
 
 banner = sys.version.splitlines()[0]
 
@@ -241,6 +246,10 @@
         child = self.spawn([])
         child.expect('Python ')   # banner
         child.expect('>>> ')      # prompt
+        if is_release:
+            assert irc_header not in child.before
+        else:
+            assert irc_header in child.before
         child.sendline('[6*7]')
         child.expect(re.escape('[42]'))
         child.sendline('def f(x):')


More information about the pypy-commit mailing list