Merge pull request #5373 from wiredfool/valgrind_test_warnings

Fix pytest valgrind warnings
This commit is contained in:
Hugo van Kemenade 2021-04-01 12:17:50 +03:00 committed by GitHub
commit b90c73f08d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,4 @@
import io
import warnings
import pytest
def pytest_report_header(config):
@ -19,13 +16,11 @@ def pytest_configure(config):
# We're marking some tests to ignore valgrind errors and XFAIL them.
# Ensure that the mark is defined
# even in cases where pytest-valgrind isn't installed
with warnings.catch_warnings():
warnings.simplefilter("error")
try:
getattr(pytest.mark, "valgrind_known_error")
except Exception:
config.addinivalue_line(
"markers",
"valgrind_known_error: Tests that have known issues with valgrind",
)
try:
config.addinivalue_line(
"markers",
"valgrind_known_error: Tests that have known issues with valgrind",
)
except Exception:
# valgrind is already installed
pass