test(pytest-plugin): add plugin tests
Cover validate_text assertions, fixture factories, marker registration, and pytest integration using pytester for subprocess testing.
This commit is contained in:
32
tests/test_pytest_plugin/conftest.py
Normal file
32
tests/test_pytest_plugin/conftest.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""Pytest configuration for pytest_plugin tests."""
|
||||
|
||||
import pytest
|
||||
|
||||
from veritext.pytest_plugin.fixtures import ValidatorFactory
|
||||
|
||||
# Enable the pytester fixture for plugin testing
|
||||
pytest_plugins = ["pytester"]
|
||||
|
||||
# Re-export fixtures from the plugin module for testing
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def text_validator() -> ValidatorFactory:
|
||||
"""Provide a factory for building validators."""
|
||||
return ValidatorFactory()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def validation_context() -> type:
|
||||
"""Provide a factory for creating ValidationContext objects."""
|
||||
from typing import Any
|
||||
|
||||
from veritext.core.types import ValidationContext
|
||||
|
||||
def _create(
|
||||
reference: str | list[str] | None = None,
|
||||
**metadata: Any,
|
||||
) -> ValidationContext:
|
||||
return ValidationContext(reference=reference, metadata=metadata)
|
||||
|
||||
return _create
|
||||
Reference in New Issue
Block a user