Skip to content

Commit d436d75

Browse files
committed
test: add conftest.py to register example marker
- Adds a conftest.py file in tests/examples to register the pytest.mark.example marker - Eliminates pytest warnings about unknown markers in example tests - Improves test output by removing noise from warnings
1 parent 6bdbb5c commit d436d75

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/examples/conftest.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Pytest configuration for example tests."""
2+
3+
from __future__ import annotations
4+
5+
import pytest # noqa: F401 - Need this import for pytest hooks to work
6+
7+
8+
def pytest_configure(config) -> None:
9+
"""Register custom pytest markers."""
10+
config.addinivalue_line(
11+
"markers",
12+
"example: mark a test as an example that demonstrates how to use the library",
13+
)

0 commit comments

Comments
 (0)