diff options
author | mattip <matti.picus@gmail.com> | 2014-05-06 20:00:27 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2014-05-06 20:00:27 +0300 |
commit | ba2d24c6ab1e0bbb96edd3354e9a25f055bce911 (patch) | |
tree | f426a5f34c6bbaf2f64bd9c5e95b9f215bbf9513 | |
parent | document when the #pypy IRC topic will be displayed (diff) | |
download | pypy-ba2d24c6ab1e0bbb96edd3354e9a25f055bce911.tar.gz pypy-ba2d24c6ab1e0bbb96edd3354e9a25f055bce911.tar.bz2 pypy-ba2d24c6ab1e0bbb96edd3354e9a25f055bce911.zip |
test for irc topic message only on release versions
-rw-r--r-- | lib_pypy/_pypy_interact.py | 5 | ||||
-rw-r--r-- | pypy/interpreter/test/test_app_main.py | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib_pypy/_pypy_interact.py b/lib_pypy/_pypy_interact.py index 9b60084d9c..1784ed521b 100644 --- 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 @@ def interactive_console(mainmodule=None, quiet=False): 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 index 7cd7c76ccc..367b68d966 100644 --- a/pypy/interpreter/test/test_app_main.py +++ b/pypy/interpreter/test/test_app_main.py @@ -7,6 +7,11 @@ import sys, os, re, runpy, subprocess 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 @@ class TestInteraction: 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):') |