|
42 | 42 | except NameError:
|
43 | 43 | WindowsError = None
|
44 | 44 |
|
| 45 | +from numpy.testing import assert_allclose |
| 46 | +from numpy.testing import assert_almost_equal |
| 47 | +from numpy.testing import assert_approx_equal |
| 48 | +from numpy.testing import assert_array_equal |
| 49 | +from numpy.testing import assert_array_almost_equal |
| 50 | +from numpy.testing import assert_array_less |
| 51 | +import numpy as np |
| 52 | + |
45 | 53 | import sklearn
|
46 |
| -from sklearn.base import BaseEstimator |
| 54 | +from sklearn.base import (BaseEstimator, ClassifierMixin, ClusterMixin, |
| 55 | + RegressorMixin, TransformerMixin) |
| 56 | +from sklearn.utils import deprecated, IS_PYPY, _IS_32BIT |
47 | 57 | from sklearn.utils._joblib import joblib
|
| 58 | +from sklearn.utils._unittest_backport import TestCase |
48 | 59 | from sklearn.utils.fixes import signature
|
49 |
| -from sklearn.utils import deprecated, IS_PYPY, _IS_32BIT |
50 |
| - |
51 | 60 |
|
52 | 61 | additional_names_in_all = []
|
53 | 62 | try:
|
|
73 | 82 | except ImportError:
|
74 | 83 | pass
|
75 | 84 |
|
76 |
| -from numpy.testing import assert_almost_equal |
77 |
| -from numpy.testing import assert_array_equal |
78 |
| -from numpy.testing import assert_array_almost_equal |
79 |
| -from numpy.testing import assert_array_less |
80 |
| -from numpy.testing import assert_approx_equal |
81 |
| -import numpy as np |
82 |
| - |
83 |
| -from sklearn.base import (ClassifierMixin, RegressorMixin, TransformerMixin, |
84 |
| - ClusterMixin) |
85 |
| -from sklearn.utils._unittest_backport import TestCase |
86 |
| - |
87 | 85 | __all__ = ["assert_equal", "assert_not_equal", "assert_raises",
|
88 | 86 | "assert_raises_regexp", "assert_true",
|
89 | 87 | "assert_false", "assert_almost_equal", "assert_array_equal",
|
90 | 88 | "assert_array_almost_equal", "assert_array_less",
|
91 | 89 | "assert_less", "assert_less_equal",
|
92 | 90 | "assert_greater", "assert_greater_equal",
|
93 |
| - "assert_approx_equal", "SkipTest"] |
| 91 | + "assert_approx_equal", "assert_allclose", "SkipTest"] |
94 | 92 | __all__.extend(additional_names_in_all)
|
95 | 93 |
|
96 | 94 | _dummy = TestCase('__init__')
|
@@ -379,11 +377,6 @@ def __exit__(self, *exc_info):
|
379 | 377 | clean_warning_registry()
|
380 | 378 |
|
381 | 379 |
|
382 |
| -assert_less = _dummy.assertLess |
383 |
| -assert_greater = _dummy.assertGreater |
384 |
| - |
385 |
| -assert_allclose = np.testing.assert_allclose |
386 |
| - |
387 | 380 | def assert_raise_message(exceptions, message, function, *args, **kwargs):
|
388 | 381 | """Helper function to test the message raised in an exception.
|
389 | 382 |
|
|
0 commit comments