mattip  committed adbfbb5

test, fix to only output IRC topic if nonrelease or if PYPY_IRC_TOPIC set

  • Participants
  • Parent commits 6a78aac
  • Branches default

Comments (0)

Files changed (2)

File pypy/interpreter/

     if inspect_requested():
             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:

File pypy/interpreter/test/

 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"
  1. Brian Kearns

    This is testing sys.version_info of the hosting python... so not correct (might as well just have said is_release=True). Also, the tests pass, meaning the tests are also flawed. One should be able to test behavior for both cases -- ie monkeypatching to test behavior for both dev and release.

 banner = sys.version.splitlines()[0]
         child.sendline("'' in sys.path")
+    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/ in this case