-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathconftest.py
More file actions
22 lines (15 loc) 路 578 Bytes
/
Copy pathconftest.py
File metadata and controls
22 lines (15 loc) 路 578 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Test setup for doctests."""
# For the fixture to be available when running doctests, this file must be placed
# in the `src/` tree or outside of it, not in the `tests/` tree.
from typing import Any
import pytest
from rich.pretty import pprint
def doctest_print(*args: Any) -> None: # noqa: ANN401, D103
return pprint(
*args,
expand_all=True,
indent_guides=False,
)
@pytest.fixture(autouse=True, scope="session")
def pprint_setup(doctest_namespace: dict[str, Any]) -> None: # noqa: D103
doctest_namespace["pprint"] = doctest_print