Skip to content

Conftest

Shared PyTest configuration for the service-as-consumer/provider example.

Attributes

EXAMPLE_DIR = Path(__file__).parent.resolve() module-attribute

Functions

pacts_path() -> Path

Fixture for the Pact directory.

RETURNS DESCRIPTION
Path

Path to the directory where Pact contract files are written.

Source code in examples/http/service_consumer_provider/conftest.py
@pytest.fixture(scope="session")
def pacts_path() -> Path:
    """
    Fixture for the Pact directory.

    Returns:
        Path to the directory where Pact contract files are written.
    """
    return EXAMPLE_DIR / "pacts"