summaryrefslogtreecommitdiff
path: root/numpy/testing/utils.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2017-07-07 19:55:52 -0600
committerxoviat <xoviat@users.noreply.github.com>2017-12-22 17:30:49 -0600
commit604d21792b6e1125dae54f1905bcd8b4a70e912f (patch)
tree3e91a013cc4c62126944863b2d427d7bc1aeb2ef /numpy/testing/utils.py
parent159326f4ae62e5121142a76b79e20a226322ce77 (diff)
downloadnumpy-604d21792b6e1125dae54f1905bcd8b4a70e912f.tar.gz
ENH: Make numpy.testing pytest aware.
When the environment has NPY_PYTEST=1, the testing utilities will be pytest compatible. Typical usage would be something like $ NPY_PYTEST=1 pytest ...
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r--numpy/testing/utils.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index 7ecb68f47..985fbf77d 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -3,6 +3,13 @@ Back compatibility utils module. It will import the appropriate
set of tools
"""
+import os
+
+if int(os.getenv('NPY_PYTEST', '0')):
+ from .pytest_tools.utils import *
+else:
+ from .nose_tools.utils import *
+
__all__ = [
'assert_equal', 'assert_almost_equal', 'assert_approx_equal',
'assert_array_equal', 'assert_array_less', 'assert_string_equal',
@@ -16,5 +23,3 @@ __all__ = [
'HAS_REFCOUNT', 'suppress_warnings', 'assert_array_compare',
'_assert_valid_refcount', '_gen_alignment_data',
]
-
-from .nose_tools.utils import *