Add error_scope to detail::get_internals() (#3981)

* Add `error_scope` to `detail::get_internals()`

* Adjust test to tolerate macOS PyPy behavior.
This commit is contained in:
Ralf W. Grosse-Kunstleve
2022-05-31 11:51:13 -07:00
committed by GitHub
parent 8da58da539
commit de4ba92c9f
5 changed files with 69 additions and 0 deletions

View File

@@ -320,3 +320,12 @@ def test_flaky_exception_failure_point_str():
with pytest.raises(ValueError) as excinfo:
m.error_already_set_what(FlakyException, ("failure_point_str",))
assert str(excinfo.value) == "triggered_failure_point_str"
def test_cross_module_interleaved_error_already_set():
with pytest.raises(RuntimeError) as excinfo:
m.test_cross_module_interleaved_error_already_set()
assert str(excinfo.value) in (
"2nd error.", # Almost all platforms.
"RuntimeError: 2nd error.", # Some PyPy builds (seen under macOS).
)