Elffuss BraidHub

kikocis/auto-code-rover public

main · 8.2 KiBRawPermalink
1INTERNALERROR when exception in __repr__
2Minimal code to reproduce the issue:
3```python
4class SomeClass:
5 def __getattribute__(self, attr):
6 raise
7 def __repr__(self):
8 raise
9def test():
10 SomeClass().attr
11```
12Session traceback:
13```
14============================= test session starts ==============================
15platform darwin -- Python 3.8.1, pytest-5.4.1, py-1.8.1, pluggy-0.13.1 -- /usr/local/opt/python@3.8/bin/python3.8
16cachedir: .pytest_cache
17rootdir: ******
18plugins: asyncio-0.10.0, mock-3.0.0, cov-2.8.1
19collecting ... collected 1 item
20
21test_pytest.py::test
22INTERNALERROR> Traceback (most recent call last):
23INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/main.py", line 191, in wrap_session
24INTERNALERROR> session.exitstatus = doit(config, session) or 0
25INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/main.py", line 247, in _main
26INTERNALERROR> config.hook.pytest_runtestloop(session=session)
27INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
28INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
29INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
30INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
31INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
32INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
33INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
34INTERNALERROR> return outcome.get_result()
35INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
36INTERNALERROR> raise ex[1].with_traceback(ex[2])
37INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
38INTERNALERROR> res = hook_impl.function(*args)
39INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/main.py", line 272, in pytest_runtestloop
40INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
41INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
42INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
43INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
44INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
45INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
46INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
47INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
48INTERNALERROR> return outcome.get_result()
49INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
50INTERNALERROR> raise ex[1].with_traceback(ex[2])
51INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
52INTERNALERROR> res = hook_impl.function(*args)
53INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/runner.py", line 85, in pytest_runtest_protocol
54INTERNALERROR> runtestprotocol(item, nextitem=nextitem)
55INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/runner.py", line 100, in runtestprotocol
56INTERNALERROR> reports.append(call_and_report(item, "call", log))
57INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/runner.py", line 188, in call_and_report
58INTERNALERROR> report = hook.pytest_runtest_makereport(item=item, call=call)
59INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
60INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
61INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
62INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
63INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
64INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
65INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 203, in _multicall
66INTERNALERROR> gen.send(outcome)
67INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/skipping.py", line 129, in pytest_runtest_makereport
68INTERNALERROR> rep = outcome.get_result()
69INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
70INTERNALERROR> raise ex[1].with_traceback(ex[2])
71INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
72INTERNALERROR> res = hook_impl.function(*args)
73INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/runner.py", line 260, in pytest_runtest_makereport
74INTERNALERROR> return TestReport.from_item_and_call(item, call)
75INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/reports.py", line 294, in from_item_and_call
76INTERNALERROR> longrepr = item.repr_failure(excinfo)
77INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/python.py", line 1513, in repr_failure
78INTERNALERROR> return self._repr_failure_py(excinfo, style=style)
79INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/nodes.py", line 355, in _repr_failure_py
80INTERNALERROR> return excinfo.getrepr(
81INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_code/code.py", line 634, in getrepr
82INTERNALERROR> return fmt.repr_excinfo(self)
83INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_code/code.py", line 879, in repr_excinfo
84INTERNALERROR> reprtraceback = self.repr_traceback(excinfo_)
85INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_code/code.py", line 823, in repr_traceback
86INTERNALERROR> reprentry = self.repr_traceback_entry(entry, einfo)
87INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_code/code.py", line 784, in repr_traceback_entry
88INTERNALERROR> reprargs = self.repr_args(entry) if not short else None
89INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_code/code.py", line 693, in repr_args
90INTERNALERROR> args.append((argname, saferepr(argvalue)))
91INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_io/saferepr.py", line 82, in saferepr
92INTERNALERROR> return SafeRepr(maxsize).repr(obj)
93INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_io/saferepr.py", line 51, in repr
94INTERNALERROR> s = _format_repr_exception(exc, x)
95INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_io/saferepr.py", line 23, in _format_repr_exception
96INTERNALERROR> exc_info, obj.__class__.__name__, id(obj)
97INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_io/saferepr.py", line 47, in repr
98INTERNALERROR> s = super().repr(x)
99INTERNALERROR> File "/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/reprlib.py", line 52, in repr
100INTERNALERROR> return self.repr1(x, self.maxlevel)
101INTERNALERROR> File "/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/reprlib.py", line 62, in repr1
102INTERNALERROR> return self.repr_instance(x, level)
103INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_io/saferepr.py", line 60, in repr_instance
104INTERNALERROR> s = _format_repr_exception(exc, x)
105INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_io/saferepr.py", line 23, in _format_repr_exception
106INTERNALERROR> exc_info, obj.__class__.__name__, id(obj)
107INTERNALERROR> File "/usr/local/lib/python3.8/site-packages/_pytest/_io/saferepr.py", line 56, in repr_instance
108INTERNALERROR> s = repr(x)
109INTERNALERROR> File "/Users/stiflou/Documents/projets/apischema/tests/test_pytest.py", line 6, in __repr__
110INTERNALERROR> raise
111INTERNALERROR> RuntimeError: No active exception to reraise
112
113============================ no tests ran in 0.09s ============================
114```