diff --git a/src/veritext/pytest_plugin/__init__.py b/src/veritext/pytest_plugin/__init__.py new file mode 100644 index 0000000..5a6db4a --- /dev/null +++ b/src/veritext/pytest_plugin/__init__.py @@ -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"] diff --git a/src/veritext/pytest_plugin/plugin.py b/src/veritext/pytest_plugin/plugin.py new file mode 100644 index 0000000..9d4234c --- /dev/null +++ b/src/veritext/pytest_plugin/plugin.py @@ -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", + )