-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
plugin: warningsrelated to the warnings builtin pluginrelated to the warnings builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
The following example should not print any warnings:
import pytest, warnings
@pytest.mark.filterwarnings(r"ignore:some \(warning\)")
def test_foo():
warnings.warn(UserWarning("some (warning)"))
λ pytest .tmp\test-warn-regex.py
======================== test session starts ========================
...
collected 1 item
.tmp\test-warn-regex.py . [100%]
========================= warnings summary ==========================
test-warn-regex.py::test_foo
c:\pytest\.tmp\test-warn-regex.py:6: UserWarning: some (warning)
warnings.warn(UserWarning("some (warning)"))
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=============== 1 passed, 1 warnings in 0.02 seconds ================
Metadata
Metadata
Assignees
Labels
plugin: warningsrelated to the warnings builtin pluginrelated to the warnings builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed