Pillow/Tests/conftest.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
956 B
Python
Raw Permalink Normal View History

from __future__ import annotations
2024-01-20 14:23:03 +03:00
import io
2024-01-21 08:47:38 +03:00
import pytest
2024-01-21 08:47:38 +03:00
def pytest_report_header(config: pytest.Config) -> str:
try:
from PIL import features
with io.StringIO() as out:
features.pilinfo(out=out, supported_formats=False)
return out.getvalue()
except Exception as e:
return f"pytest_report_header failed: {e}"
2020-12-30 06:41:22 +03:00
2024-01-21 08:47:38 +03:00
def pytest_configure(config: pytest.Config) -> None:
2021-04-10 13:03:15 +03:00
config.addinivalue_line(
"markers",
"pil_noop_mark: A conditional mark where nothing special happens",
)
# We're marking some tests to ignore valgrind errors and XFAIL them.
2020-12-30 06:41:22 +03:00
# Ensure that the mark is defined
# even in cases where pytest-valgrind isn't installed
2021-03-12 01:13:15 +03:00
try:
config.addinivalue_line(
"markers",
"valgrind_known_error: Tests that have known issues with valgrind",
)
except Exception:
# valgrind is already installed
pass