Coverage for tests / test_docstrings / conftest.py: 100.00%
14 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-02-11 11:48 +0100
« prev ^ index » next coverage.py v7.13.4, created at 2026-02-11 11:48 +0100
1"""Pytest fixture for docstrings tests."""
3from __future__ import annotations
5from typing import TYPE_CHECKING
7import pytest
9from griffe._internal.docstrings import google, numpy, sphinx
10from tests.test_docstrings.helpers import ParserType, parser
12if TYPE_CHECKING:
13 from collections.abc import Iterator
16@pytest.fixture
17def parse_google() -> Iterator[ParserType]:
18 """Yield a function to parse Google docstrings.
20 Yields:
21 A parser function.
22 """
23 yield from parser(google)
26@pytest.fixture
27def parse_numpy() -> Iterator[ParserType]:
28 """Yield a function to parse Numpy docstrings.
30 Yields:
31 A parser function.
32 """
33 yield from parser(numpy)
36@pytest.fixture
37def parse_sphinx() -> Iterator[ParserType]:
38 """Yield a function to parse Sphinx docstrings.
40 Yields:
41 A parser function.
42 """
43 yield from parser(sphinx)