Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/interpreter/test/test_app_main.py::TestNonInteractive::()::test_i_flag_overrides_isatty

self = <pypy.interpreter.test.test_app_main.TestNonInteractive instance at 0x000000001f9ee4a0>

    def test_i_flag_overrides_isatty(self):
        data = self.run('-i', senddata='6*7\nraise SystemExit\n',
>                             expect_prompt=True, expect_banner=True)

interpreter/test/test_app_main.py:964: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
interpreter/test/test_app_main.py:810: in run
    data, status = self.run_with_status_code(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pypy.interpreter.test.test_app_main.TestNonInteractive instance at 0x000000001f9ee4a0>
cmdline = '/usr/local/bin/python3.12  "/buildbot/slave/own-linux-x86-64/build/pypy/interpreter/app_main.py"  -i'
senddata = '6*7\nraise SystemExit\n', expect_prompt = True, expect_banner = True
python_flags = '', env = None

    def run_with_status_code(self, cmdline, senddata='', expect_prompt=False,
            expect_banner=False, python_flags='', env=None):
        if os.name == 'nt':
            try:
                import __pypy__
            except:
                py.test.skip('app_main cannot run on non-pypy for windows')
        cmdline = '%s %s "%s" %s %s' % (get_python3(), python_flags,
                                     app_main, python_flags, cmdline)
        print('POPEN:', cmdline)
        process = subprocess.Popen(
            cmdline,
            stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
            shell=True, env=env,
            universal_newlines=True
        )
        child_in, child_out_err = process.stdin, process.stdout
        child_in.write(senddata)
        child_in.close()
        data = child_out_err.read()
        child_out_err.close()
        process.wait()
        assert (banner in data) == expect_banner   # no banner unless expected
>       assert ('>>>> ' in data) == expect_prompt   # no prompt unless expected
E       assert '>>>> ' in 'Python 3.12.13 (main, May 13 2026, 03:55:23) [GCC 14.2.1 20250110 (Red Hat 14.2.1-11)] on linux\nType "help", "copyri...dtuple\n    exec(code, namespace)\n  File "<string>", line 1, in <module>\nNameError: name \'object\' is not defined\n' == True

interpreter/test/test_app_main.py:805: AssertionError
---------- Captured stdout call ----------
POPEN: /usr/local/bin/python3.12  "/buildbot/slave/own-linux-x86-64/build/pypy/interpreter/app_main.py"  -i
builder: own-linux-x86-64 build #11021+
test: pypy/interpreter/test/test_app_main.py::TestNonInteractive::()::test_i_flag_overrides_isatty