Open kenodegard opened 6 months ago
Nice, thanks @kenodegard!
Comparing kenodegard:fix-outerr-redirects
(26b5d09) with master
(90e639b)
✅ 5
untouched benchmarks
@art049 thanks for running the tests
pushed https://github.com/CodSpeedHQ/pytest-codspeed/pull/25/commits/59ea7ad0db3af9e0edee4630cd01b99352afaaa3 to resolve the typing failure in Python<3.10 and https://github.com/CodSpeedHQ/pytest-codspeed/pull/25/commits/2b026dd7d52fb8e165849ad059276b7b65cb429d to resolve the perf trampoline test failure on Python 3.12
@art049 anything more to do here?
It's a bit annoying that formatter changes and logic change are in the same PR in the end. I'll maybe try to split things out.
Resolves #24
Changes include:
item.ihook.pytest_runtest_call(item=item)
instead of directly callingitem.runtest()
to benefit from pytest's automatic handling ofsys.last_type
,sys.last_value
,sys.last_execption
(apparently not handling this causes stdout/stderr to be redirected and inaccessible within tests, see https://github.com/pytest-dev/pytest/blob/3b798e54221f1895a983000c7e5bc8afdacd5011/src/_pytest/runner.py#L165-L182)~pytest_runtest_protocol
hook topytest_pyfunc_call
hook (deeper in the call stack,pytest_pyfunc_call
is invoked fromruntest
which in turn is called frompytest_runtest_call
)