diff options
Diffstat (limited to 'numpy/polynomial/tests/test_classes.py')
-rw-r--r-- | numpy/polynomial/tests/test_classes.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/numpy/polynomial/tests/test_classes.py b/numpy/polynomial/tests/test_classes.py index 373379435..c01342203 100644 --- a/numpy/polynomial/tests/test_classes.py +++ b/numpy/polynomial/tests/test_classes.py @@ -20,7 +20,7 @@ classes = ( Hermite, HermiteE) -def test_class_methods(): +def check_class_methods(): """Test all class methods""" for Poly1 in classes: for Poly2 in classes: @@ -52,6 +52,8 @@ def test_class_methods(): yield check_truncate, Poly yield check_trim, Poly + + # # helper functions # @@ -516,5 +518,21 @@ def check_mapparms(Poly) : p = Poly([1], domain=d, window=w) assert_almost_equal([1, 2], p.mapparms()) +for test in check_class_methods(): + if len(test) == 3: + f, a, b = [t.__name__ for t in test] + prefix = "def %s_%s_%s(): " % (f, a, b) + prefix = prefix.replace('check', 'test') + suffix = "%s(%s, %s)" % (f, a, b) + exec prefix + suffix + if len(test) == 2: + f, a = [t.__name__ for t in test] + prefix = "def %s_%s(): " % (f, a) + prefix = prefix.replace('check', 'test') + suffix = "%s(%s)" % (f, a) + exec prefix + suffix + + + if __name__ == "__main__": run_module_suite() |