Skip to content

Commit 0a49449

Browse files
committed
TEST: Use numpy 1.13 legacy print settings
1 parent d9c385a commit 0a49449

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

nibabel/conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pytest
2+
3+
4+
@pytest.fixture(autouse=True, scope="session")
5+
def set_printopts():
6+
import numpy as np
7+
from distutils.version import LooseVersion
8+
9+
if LooseVersion(np.__version__) >= LooseVersion("1.14"):
10+
legacy_printopt = np.get_printoptions().get("legacy")
11+
np.set_printoptions(legacy="1.13")
12+
yield
13+
np.set_printoptions(legacy=legacy_printopt)
14+
else:
15+
yield

0 commit comments

Comments
 (0)