File: conftest.py

package info (click to toggle)
py-moneyed 2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 196 kB
  • sloc: python: 632; makefile: 17
file content (16 lines) | stat: -rw-r--r-- 439 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from typing import Dict

import pytest

from moneyed import USD, Money


@pytest.fixture(autouse=True)
def add_entities(doctest_namespace: Dict[str, object]) -> None:
    """
    Inserts entities into doctest namespaces so that imports don't have to be added to
    all examples.
    https://docs.pytest.org/en/stable/doctest.html#doctest-namespace-fixture
    """
    doctest_namespace["Money"] = Money
    doctest_namespace["USD"] = USD