From 22a6893364c28e3125cbc40f22efa3173f3b851e Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Thu, 11 Mar 2021 23:13:15 +0100 Subject: [PATCH 1/2] Fix pytest valgrind warnings --- Tests/conftest.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Tests/conftest.py b/Tests/conftest.py index 6f9945204..11ec820ac 100644 --- a/Tests/conftest.py +++ b/Tests/conftest.py @@ -19,13 +19,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 From 37f9fcf93b2399db6b70ff363776ad4df5bad117 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 1 Apr 2021 12:57:34 +1100 Subject: [PATCH 2/2] Removed unused imports --- Tests/conftest.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/Tests/conftest.py b/Tests/conftest.py index 11ec820ac..dd37e7ce5 100644 --- a/Tests/conftest.py +++ b/Tests/conftest.py @@ -1,7 +1,4 @@ import io -import warnings - -import pytest def pytest_report_header(config):