-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathconftest.py
More file actions
30 lines (23 loc) · 773 Bytes
/
conftest.py
File metadata and controls
30 lines (23 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""Configure our testing suite."""
import networkx as nx
import numpy as np
import pytest
import toponetx as tnx
@pytest.fixture(autouse=True)
def doctest_default_imports(doctest_namespace) -> None:
"""Add default imports to the doctest namespace.
This fixture adds the following default imports to every doctest, so that their use
is consistent across all doctests without boilerplate imports polluting the
doctests themselves:
.. code-block:: python
import numpy as np
import networkx as nx
import toponetx as tnx
Parameters
----------
doctest_namespace : dict
The namespace of the doctest.
"""
doctest_namespace["np"] = np
doctest_namespace["nx"] = nx
doctest_namespace["tnx"] = tnx