Skip to content

Commit b90c73f

Browse files
authored
Merge pull request #5373 from wiredfool/valgrind_test_warnings
Fix pytest valgrind warnings
2 parents cafd389 + 37f9fcf commit b90c73f

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

Tests/conftest.py

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import io
2-
import warnings
3-
4-
import pytest
52

63

74
def pytest_report_header(config):
@@ -19,13 +16,11 @@ def pytest_configure(config):
1916
# We're marking some tests to ignore valgrind errors and XFAIL them.
2017
# Ensure that the mark is defined
2118
# even in cases where pytest-valgrind isn't installed
22-
23-
with warnings.catch_warnings():
24-
warnings.simplefilter("error")
25-
try:
26-
getattr(pytest.mark, "valgrind_known_error")
27-
except Exception:
28-
config.addinivalue_line(
29-
"markers",
30-
"valgrind_known_error: Tests that have known issues with valgrind",
31-
)
19+
try:
20+
config.addinivalue_line(
21+
"markers",
22+
"valgrind_known_error: Tests that have known issues with valgrind",
23+
)
24+
except Exception:
25+
# valgrind is already installed
26+
pass

0 commit comments

Comments
 (0)