File: conftest.py

package info (click to toggle)
pint-xarray 0.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 456 kB
  • sloc: python: 4,477; sh: 10; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 579 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest


@pytest.fixture(autouse=True)
def add_standard_imports(doctest_namespace, tmpdir):
    import numpy as np
    import pandas as pd
    import pint
    import xarray as xr

    import pint_xarray

    ureg = pint.UnitRegistry(force_ndarray_like=True)

    doctest_namespace["np"] = np
    doctest_namespace["pd"] = pd
    doctest_namespace["xr"] = xr
    doctest_namespace["pint"] = pint
    doctest_namespace["ureg"] = ureg
    doctest_namespace["pint_xarray"] = pint_xarray

    # always seed numpy.random to make the examples deterministic
    np.random.seed(0)