mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 02:36:17 +03:00
Merge pull request #5373 from wiredfool/valgrind_test_warnings
Fix pytest valgrind warnings
This commit is contained in:
commit
b90c73f08d
|
@ -1,7 +1,4 @@
|
||||||
import io
|
import io
|
||||||
import warnings
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_report_header(config):
|
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.
|
# 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
|
||||||
|
|
||||||
with warnings.catch_warnings():
|
|
||||||
warnings.simplefilter("error")
|
|
||||||
try:
|
try:
|
||||||
getattr(pytest.mark, "valgrind_known_error")
|
|
||||||
except Exception:
|
|
||||||
config.addinivalue_line(
|
config.addinivalue_line(
|
||||||
"markers",
|
"markers",
|
||||||
"valgrind_known_error: Tests that have known issues with valgrind",
|
"valgrind_known_error: Tests that have known issues with valgrind",
|
||||||
)
|
)
|
||||||
|
except Exception:
|
||||||
|
# valgrind is already installed
|
||||||
|
pass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user