From 604d21792b6e1125dae54f1905bcd8b4a70e912f Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Fri, 7 Jul 2017 19:55:52 -0600 Subject: 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 ... --- numpy/testing/utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'numpy/testing/utils.py') 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 * -- cgit v1.2.1