MCPcopy Create free account
hub / github.com/pybind/pybind11 / ignore_pytest_unraisable_warning

Function ignore_pytest_unraisable_warning

tests/test_exceptions.py:96–101  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

94
95
96def ignore_pytest_unraisable_warning(f):
97 unraisable = "PytestUnraisableExceptionWarning"
98 if hasattr(pytest, unraisable): # Python >= 3.8 and pytest >= 6
99 dec = pytest.mark.filterwarnings(f"ignore::pytest.{unraisable}")
100 return dec(f)
101 return f
102
103
104# TODO: find out why this fails on PyPy, https://foss.heptapod.net/pypy/pypy/-/issues/3583

Callers

nothing calls this directly

Calls 1

hasattrFunction · 0.85

Tested by

no test coverage detected