pypy/interpreter/test/test_app_main.py::TestInteraction::()::test_set_pythoninspect
self = <pypy.interpreter.test.test_app_main.TestInteraction instance at 0x19c9d664>
def test_set_pythoninspect(self):
path = getscript("""
import os
os.environ['PYTHONINSPECT'] = '1'
print(6*7)
""")
child = self.spawn([path])
child.expect('42')
> child.expect('>>> ')
interpreter/test/test_app_main.py:734:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../virt_test/site-packages/pexpect/spawnbase.py:355: in expect
timeout, searchwindowsize, async_)
../virt_test/site-packages/pexpect/spawnbase.py:383: in expect_list
return exp.expect_loop(timeout)
../virt_test/site-packages/pexpect/expect.py:179: in expect_loop
return self.eof(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pexpect.expect.Expecter object at 0x19ca4f30>
err = EOF('End Of File (EOF). Exception style platform.',)
def eof(self, err=None):
spawn = self.spawn
spawn.before = spawn._before.getvalue()
spawn._buffer = spawn.buffer_type()
spawn._before = spawn.buffer_type()
spawn.after = EOF
index = self.searcher.eof_index
if index >= 0:
spawn.match = EOF
spawn.match_index = index
return index
else:
spawn.match = None
spawn.match_index = None
msg = str(spawn)
msg += '\nsearcher: %s' % self.searcher
if err is not None:
msg = str(err) + '\n' + msg
exc = EOF(msg)
exc.__cause__ = None # in Python 3.x we can use "raise exc from None"
> raise exc
E EOF: End Of File (EOF). Exception style platform.
E <pexpect.pty_spawn.spawn object at 0x19ca4e10>
E command: /usr/local/bin/python3.12
E args: ['/usr/local/bin/python3.12', '/buildbot/slave/own-linux-x86-32/build/pypy/interpreter/app_main.py', '/tmp/pytest/usession-py3.12-5272/demo_test_app_main_12.py']
E buffer (last 100 chars): ''
E before (last 100 chars): '(code, namespace)\r\n File "<string>", line 1, in <module>\r\nNameError: name \'object\' is not defined\r\n'
E after: <class 'pexpect.exceptions.EOF'>
E match: None
E match_index: None
E exitstatus: None
E flag_eof: True
E pid: 140988
E child_fd: 211
E closed: False
E timeout: 10
E delimiter: <class 'pexpect.exceptions.EOF'>
E logfile: <_pytest.capture.EncodedFile object at 0x09bda1d0>
E logfile_read: None
E logfile_send: None
E maxread: 2000
E ignorecase: False
E searchwindowsize: None
E delaybeforesend: 0.05
E delayafterclose: 0.1
E delayafterterminate: 0.1
E searcher: searcher_re:
E 0: re.compile('>>> ')
../virt_test/site-packages/pexpect/expect.py:122: EOF
---------- Captured stdout call ----------
SPAWN: /usr/local/bin/python3.12 /buildbot/slave/own-linux-x86-32/build/pypy/interpreter/app_main.py /tmp/pytest/usession-py3.12-5272/demo_test_app_main_12.py {'env': None, 'timeout': 10}
42
Traceback (most recent call last):
File "/buildbot/slave/own-linux-x86-32/build/pypy/interpreter/app_main.py", line 166, in run_toplevel
f(*fargs, **fkwds)
File "<frozen site>", line 462, in register_readline
File "/buildbot/slave/own-linux-x86-32/build/lib_pypy/readline.py", line 10, in <module>
from pyrepl.readline import *
File "/buildbot/slave/own-linux-x86-32/build/lib_pypy/pyrepl/readline.py", line 32, in <module>
from dataclasses import dataclass, field
File "/buildbot/slave/own-linux-x86-32/build/lib-python/3/dataclasses.py", line 1, in <module>
import re
File "/buildbot/slave/own-linux-x86-32/build/lib-python/3/re/__init__.py", line 124, in <module>
import enum
File "/buildbot/slave/own-linux-x86-32/build/lib-python/3/enum.py", line 5, in <module>
from functools import reduce
File "/buildbot/slave/own-linux-x86-32/build/lib-python/3/functools.py", line 442, in <module>
_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/buildbot/slave/own-linux-x86-32/build/lib-python/3/collections/__init__.py", line 492, in namedtuple
exec(code, namespace)
File "<string>", line 1, in <module>
NameError: name 'object' is not defined
Traceback (most recent call last):
File "/buildbot/slave/own-linux-x86-32/build/pypy/interpreter/app_main.py", line 166, in run_toplevel
f(*fargs, **fkwds)
File "/buildbot/slave/own-linux-x86-32/build/lib_pypy/_pypy_interact.py", line 36, in interactive_console
from pyrepl.simple_interact import check
File "/buildbot/slave/own-linux-x86-32/build/lib_pypy/pyrepl/simple_interact.py", line 29, in <module>
import linecache
File "/buildbot/slave/own-linux-x86-32/build/lib-python/3/linecache.py", line 8, in <module>
import functools
File "/buildbot/slave/own-linux-x86-32/build/lib-python/3/functools.py", line 442, in <module>
_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/buildbot/slave/own-linux-x86-32/build/lib-python/3/collections/__init__.py", line 492, in namedtuple
exec(code, namespace)
File "<string>", line 1, in <module>
NameError: name 'object' is not defined
builder: own-linux-x86-32 build #9546+
test: pypy/interpreter/test/test_app_main.py::TestInteraction::()::test_set_pythoninspect