Skip to content

Commit c51abf8

Browse files
committed
FIX: Set legacy printoptions in doctests
1 parent a150eeb commit c51abf8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nipype/conftest.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import shutil
33
from tempfile import mkdtemp
44
import pytest
5-
import numpy
5+
import numpy as np
66
import py.path as pp
77

88
NIPYPE_DATADIR = os.path.realpath(
@@ -15,12 +15,17 @@
1515

1616
@pytest.fixture(autouse=True)
1717
def add_np(doctest_namespace):
18-
doctest_namespace["np"] = numpy
18+
doctest_namespace["np"] = np
1919
doctest_namespace["os"] = os
2020
doctest_namespace["pytest"] = pytest
2121
doctest_namespace["datadir"] = data_dir
2222

2323

24+
@pytest.fixture(scope='session', autouse=True)
25+
def legacy_printoptions():
26+
np.set_printoptions(legacy='1.21')
27+
28+
2429
@pytest.fixture(autouse=True)
2530
def _docdir(request):
2631
"""Grabbed from https://stackoverflow.com/a/46991331"""

0 commit comments

Comments
 (0)