Author: mattip <[email protected]>
Branch:
Changeset: r71440:adbfbb5d604d
Date: 2014-05-10 23:16 +0300
http://bitbucket.org/pypy/pypy/changeset/adbfbb5d604d/
Log: test, fix to only output IRC topic if nonrelease or if
PYPY_IRC_TOPIC set
diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py
--- a/pypy/interpreter/app_main.py
+++ b/pypy/interpreter/app_main.py
@@ -671,7 +671,8 @@
if inspect_requested():
try:
from _pypy_interact import interactive_console
- irc_topic = readenv and os.getenv('PYPY_IRC_TOPIC')
+ irc_topic = sys.version_info[3] != 'final' or (
+ readenv and os.getenv('PYPY_IRC_TOPIC'))
success = run_toplevel(interactive_console, mainmodule,
quiet=not irc_topic)
except SystemExit, e:
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,10 +7,9 @@
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"
+is_release = sys.version_info[3] == "final"
banner = sys.version.splitlines()[0]
@@ -269,6 +268,11 @@
child.sendline("'' in sys.path")
child.expect("True")
+ def test_irc_topic(self, monkeypatch):
+ monkeypatch.setenv('PYPY_IRC_TOPIC', '1')
+ child = self.spawn([])
+ child.expect(irc_header) # banner
+
def test_help(self):
# test that -h prints the usage, including the name of the executable
# which should be /full/path/to/app_main.py in this case
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit