From 69bc7b19d2a665c8301c3df07aee61fc469ff4e3 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Mon, 17 Jul 2017 21:11:49 -0600 Subject: TST: Remove unittest dependencies in numpy/f2py/tests. --- numpy/f2py/tests/test_array_from_pyobj.py | 14 ++++++-------- numpy/f2py/tests/util.py | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'numpy') diff --git a/numpy/f2py/tests/test_array_from_pyobj.py b/numpy/f2py/tests/test_array_from_pyobj.py index 48bb7c0f4..1f6b59462 100644 --- a/numpy/f2py/tests/test_array_from_pyobj.py +++ b/numpy/f2py/tests/test_array_from_pyobj.py @@ -17,7 +17,7 @@ import util wrap = None -def setup(): +def setup_module(): """ Build the required testing extension module @@ -294,7 +294,7 @@ class Array(object): return obj_attr[0] == self.arr_attr[0] -class test_intent(unittest.TestCase): +class TestIntent(object): def test_in_out(self): assert_equal(str(intent.in_.out), 'intent(in,out)') @@ -305,7 +305,7 @@ class test_intent(unittest.TestCase): assert_(not intent.in_.is_intent('c')) -class _test_shared_memory: +class _test_shared_memory(object): num2seq = [1, 2] num23seq = [[1, 2, 3], [4, 5, 6]] @@ -578,14 +578,12 @@ class _test_shared_memory: for t in _type_names: exec('''\ -class test_%s_gen(unittest.TestCase, - _test_shared_memory - ): - def setUp(self): +class TestGen_%s(_test_shared_memory): + def setup(self): self.type = Type(%r) array = lambda self,dims,intent,obj: Array(Type(%r),dims,intent,obj) ''' % (t, t, t)) if __name__ == "__main__": - setup() + setup_module() run_module_suite() diff --git a/numpy/f2py/tests/util.py b/numpy/f2py/tests/util.py index fe608d898..55716a2eb 100644 --- a/numpy/f2py/tests/util.py +++ b/numpy/f2py/tests/util.py @@ -319,7 +319,7 @@ class F2PyTest(object): module = None module_name = None - def setUp(self): + def setup(self): if self.module is not None: return -- cgit v1.2.1