feat(pytest-plugin): add plugin hooks and markers

Register text_validation marker via pytest_configure hook.
This commit is contained in:
2026-02-03 17:40:33 +00:00
parent 107fc4e275
commit cd36c54e22
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
"""Pytest plugin for text validation.
This plugin provides native pytest integration for Veritext, enabling
text validation assertions in test suites.
Example:
>>> from veritext.pytest_plugin import validate_text
>>>
>>> def test_summary_quality():
... text = "The quick brown fox jumps over the lazy dog."
... validate_text(
... text,
... min_length=10,
... max_length=100,
... max_reading_grade=8.0,
... )
"""
from veritext.pytest_plugin.assertions import validate_text
from veritext.pytest_plugin.plugin import pytest_configure
__all__ = ["pytest_configure", "validate_text"]

View File

@@ -0,0 +1,18 @@
"""Pytest hooks for Veritext plugin."""
from typing import TYPE_CHECKING
if TYPE_CHECKING:
import pytest
def pytest_configure(config: "pytest.Config") -> None:
"""Register Veritext markers.
Args:
config: Pytest configuration object.
"""
config.addinivalue_line(
"markers",
"text_validation: mark test as a text validation test",
)