| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
src/_pytest/threadexception.py and src/_pytest/unraisableexception.py both use regular trylast hooks instead of generators, so the conflicts can be resolved by checking them out from main |
Sorry, something went wrong.
|
this won't pass without a new Pluggy release |
Sorry, something went wrong.
|
@RonnyPfannschmidt what is the status here? Do you plan to make a pluggy release yourself? |
Sorry, something went wrong.
|
Indeed I intend to give this priority by the end of the month |
Sorry, something went wrong.
as it turns out, StopIteration is not transparent on the boundaries of generators # Conflicts: # src/_pytest/threadexception.py # src/_pytest/unraisableexception.py
|
@RonnyPfannschmidt I wrote some test cases for this, I hope you find them useful: def test_stop_iteration_from_collect(pytester: Pytester) -> None:
pytester.makepyfile(test_it="raise StopIteration('hello')")
result = pytester.runpytest()
assert result.ret == ExitCode.INTERRUPTED
result.assert_outcomes(failed=0, passed=0, errors=1)
result.stdout.fnmatch_lines(
[
"=========================== short test summary info ============================",
"ERROR test_it.py - StopIteration: hello",
"!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!",
"=============================== 1 error in * ===============================",
]
)
def test_stop_iteration_runtest_protocol(pytester: Pytester) -> None:
pytester.makepyfile(
test_it="""
import pytest
@pytest.fixture
def fail_setup():
raise StopIteration(1)
def test_fail_setup(fail_setup):
pass
def test_fail_teardown(request):
def stop_iteration():
raise StopIteration(2)
request.addfinalizer(stop_iteration)
def test_fail_call():
raise StopIteration(3)
"""
)
result = pytester.runpytest()
assert result.ret == ExitCode.TESTS_FAILED
result.assert_outcomes(failed=1, passed=1, errors=2)
result.stdout.fnmatch_lines(
[
"=========================== short test summary info ============================",
"FAILED test_it.py::test_fail_call - StopIteration: 3",
"ERROR test_it.py::test_fail_setup - StopIteration: 1",
"ERROR test_it.py::test_fail_teardown - StopIteration: 2",
"==================== 1 failed, 1 passed, 2 errors in * =====================",
]
) |
Sorry, something went wrong.
|
note this is still currently blocked by a release of pytest-dev/pluggy#545 |
Sorry, something went wrong.
|
i intend to land pytest-dev/pluggy#546 as before the next release of pluggy |
Sorry, something went wrong.
|
im ok with squashing |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
yield from is a generator boundary that transfers StopIteration into a RuntimeError
closes #12929