tests.conftest module#

Test fixtures and utilities for sphinx_diagram_connect.

This module provides pytest fixtures to mock Sphinx application objects and create temporary project structures for testing the sphinx_diagram_connect extension.

tests.conftest.diagram_connect_instance(mock_sphinx_app)#

Provides an initialized DiagramConnect instance for tests.

tests.conftest.mock_logger()#

Mocks the Sphinx logger to capture log messages.

tests.conftest.mock_sphinx_app()#

Provides a mock Sphinx application object for testing.

Returns#

MagicMock

A mock Sphinx application instance with configured config, builder, and env attributes.

tests.conftest.temp_sphinx_project(tmp_path)#

Creates a temporary Sphinx project structure for integration tests.

Parameters#

tmp_pathPath

pytest fixture for a temporary directory.

Returns#

Path

The path to the root of the temporary Sphinx project.