forked from fastats/fastats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
32 lines (22 loc) · 895 Bytes
/
conftest.py
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
31
import numba
import numpy
import pkg_resources
import pytest
import scipy
@pytest.fixture(autouse=True)
def add_preconfigured_np(doctest_namespace):
"""
Fixture executed for every doctest.
Injects pre-configured numpy into each test's namespace.
Note that even with this, doctests might fail due to the lack of full
compatibility when using ``numpy.set_printoptions(legacy='1.13')``.
Some of the whitespace issues can be fixed by ``NORMALIZE_WHITESPACE``
doctest option, which is currently set in ``pytest.ini``.
See: https://github.com/numpy/numpy/issues/10383
"""
current_version = pkg_resources.parse_version(numpy.__version__)
doctest_namespace['np'] = numpy
def pytest_report_header(config):
return 'Testing fastats using: Numba {}, NumPy {}, SciPy {}'.format(
numba.__version__, numpy.__version__, scipy.__version__,
)