Fix pytest valgrind warnings

This commit is contained in:
Eric Soroos 2021-03-11 23:13:15 +01:00
parent f15f573e51
commit 22a6893364

View File

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