summaryrefslogtreecommitdiff
path: root/numpy/f2py
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2018-08-29 04:56:40 -0400
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2018-09-06 03:40:51 -0400
commit9c585ad6a97258335edca6913b8df628b6f68289 (patch)
treef7afa106963b74bccbb41a8cd4555c6ade2096f5 /numpy/f2py
parentdbd2b06ae9ee6942d4f0064641acd0ce55070dfe (diff)
downloadnumpy-9c585ad6a97258335edca6913b8df628b6f68289.tar.gz
TST: Parametrize f2py tests.
Diffstat (limited to 'numpy/f2py')
-rw-r--r--numpy/f2py/tests/test_callback.py6
-rw-r--r--numpy/f2py/tests/test_return_character.py12
-rw-r--r--numpy/f2py/tests/test_return_complex.py12
-rw-r--r--numpy/f2py/tests/test_return_integer.py14
-rw-r--r--numpy/f2py/tests/test_return_logical.py13
-rw-r--r--numpy/f2py/tests/test_return_real.py18
6 files changed, 39 insertions, 36 deletions
diff --git a/numpy/f2py/tests/test_callback.py b/numpy/f2py/tests/test_callback.py
index 4e74947b0..824ef7b0c 100644
--- a/numpy/f2py/tests/test_callback.py
+++ b/numpy/f2py/tests/test_callback.py
@@ -62,9 +62,9 @@ cf2py intent(out) a
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t,t2".split(","):
- self.check_function(name)
+ @pytest.mark.parametrize('name', 't,t2'.split(','))
+ def test_all(self, name):
+ self.check_function(name)
@pytest.mark.slow
def test_docstring(self):
diff --git a/numpy/f2py/tests/test_return_character.py b/numpy/f2py/tests/test_return_character.py
index 4a94c5b98..fc3a58d36 100644
--- a/numpy/f2py/tests/test_return_character.py
+++ b/numpy/f2py/tests/test_return_character.py
@@ -82,9 +82,9 @@ cf2py intent(out) ts
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t1,t5,s0,s1,s5,ss".split(","):
- self.check_function(getattr(self.module, name))
+ @pytest.mark.parametrize('name', 't0,t1,t5,s0,s1,s5,ss'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module, name))
class TestF90ReturnCharacter(TestReturnCharacter):
@@ -141,6 +141,6 @@ end module f90_return_char
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t1,t5,ts,s0,s1,s5,ss".split(","):
- self.check_function(getattr(self.module.f90_return_char, name))
+ @pytest.mark.parametrize('name', 't0,t1,t5,ts,s0,s1,s5,ss'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module.f90_return_char, name))
diff --git a/numpy/f2py/tests/test_return_complex.py b/numpy/f2py/tests/test_return_complex.py
index 152cfc960..43c884dfb 100644
--- a/numpy/f2py/tests/test_return_complex.py
+++ b/numpy/f2py/tests/test_return_complex.py
@@ -105,9 +105,9 @@ cf2py intent(out) td
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t8,t16,td,s0,s8,s16,sd".split(","):
- self.check_function(getattr(self.module, name))
+ @pytest.mark.parametrize('name', 't0,t8,t16,td,s0,s8,s16,sd'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module, name))
class TestF90ReturnComplex(TestReturnComplex):
@@ -164,6 +164,6 @@ end module f90_return_complex
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t8,t16,td,s0,s8,s16,sd".split(","):
- self.check_function(getattr(self.module.f90_return_complex, name))
+ @pytest.mark.parametrize('name', 't0,t8,t16,td,s0,s8,s16,sd'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module.f90_return_complex, name))
diff --git a/numpy/f2py/tests/test_return_integer.py b/numpy/f2py/tests/test_return_integer.py
index 7a4b07c4f..22f4acfdf 100644
--- a/numpy/f2py/tests/test_return_integer.py
+++ b/numpy/f2py/tests/test_return_integer.py
@@ -104,9 +104,10 @@ cf2py intent(out) t8
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t1,t2,t4,t8,s0,s1,s2,s4,s8".split(","):
- self.check_function(getattr(self.module, name))
+ @pytest.mark.parametrize('name',
+ 't0,t1,t2,t4,t8,s0,s1,s2,s4,s8'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module, name))
class TestF90ReturnInteger(TestReturnInteger):
@@ -174,6 +175,7 @@ end module f90_return_integer
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t1,t2,t4,t8,s0,s1,s2,s4,s8".split(","):
- self.check_function(getattr(self.module.f90_return_integer, name))
+ @pytest.mark.parametrize('name',
+ 't0,t1,t2,t4,t8,s0,s1,s2,s4,s8'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module.f90_return_integer, name))
diff --git a/numpy/f2py/tests/test_return_logical.py b/numpy/f2py/tests/test_return_logical.py
index 403f4e205..96f215a91 100644
--- a/numpy/f2py/tests/test_return_logical.py
+++ b/numpy/f2py/tests/test_return_logical.py
@@ -113,9 +113,9 @@ c end
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t1,t2,t4,s0,s1,s2,s4".split(","):
- self.check_function(getattr(self.module, name))
+ @pytest.mark.parametrize('name', 't0,t1,t2,t4,s0,s1,s2,s4'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module, name))
class TestF90ReturnLogical(TestReturnLogical):
@@ -183,6 +183,7 @@ end module f90_return_logical
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t1,t2,t4,t8,s0,s1,s2,s4,s8".split(","):
- self.check_function(getattr(self.module.f90_return_logical, name))
+ @pytest.mark.parametrize('name',
+ 't0,t1,t2,t4,t8,s0,s1,s2,s4,s8'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module.f90_return_logical, name))
diff --git a/numpy/f2py/tests/test_return_real.py b/numpy/f2py/tests/test_return_real.py
index fcb13e1e0..cc3c4d8f2 100644
--- a/numpy/f2py/tests/test_return_real.py
+++ b/numpy/f2py/tests/test_return_real.py
@@ -85,9 +85,9 @@ end python module c_ext_return_real
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t4,t8,s4,s8".split(","):
- self.check_function(getattr(self.module, name))
+ @pytest.mark.parametrize('name', 't4,t8,s4,s8'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module, name))
class TestF77ReturnReal(TestReturnReal):
@@ -140,9 +140,9 @@ cf2py intent(out) td
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t4,t8,td,s0,s4,s8,sd".split(","):
- self.check_function(getattr(self.module, name))
+ @pytest.mark.parametrize('name', 't0,t4,t8,td,s0,s4,s8,sd'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module, name))
class TestF90ReturnReal(TestReturnReal):
@@ -199,6 +199,6 @@ end module f90_return_real
"""
@pytest.mark.slow
- def test_all(self):
- for name in "t0,t4,t8,td,s0,s4,s8,sd".split(","):
- self.check_function(getattr(self.module.f90_return_real, name))
+ @pytest.mark.parametrize('name', 't0,t4,t8,td,s0,s4,s8,sd'.split(','))
+ def test_all(self, name):
+ self.check_function(getattr(self.module.f90_return_real, name))