Cover validate_text assertions, fixture factories, marker registration, and pytest integration using pytester for subprocess testing.
31 lines
704 B
Python
31 lines
704 B
Python
"""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:
|
|
return ValidatorFactory()
|
|
|
|
|
|
@pytest.fixture
|
|
def validation_context() -> type:
|
|
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
|