Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytest-dev/pytest
/ f
Method
f
testing/test_recwarn.py:397–399 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
395
@pytest.mark.filterwarnings(
"ignore"
)
396
def
test_can_capture_previously_warned(self) -> None:
397
def
f() -> int:
398
warnings.warn(UserWarning(
"ohai"
))
399
return
10
400
401
assert f() == 10
402
assert pytest.warns(UserWarning, f) == 10
Callers
nothing calls this directly
Calls
1
warn
Method · 0.45
Tested by
no test coverage detected