Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
TST: Backport azure-pipeline testing fixes for Mac
The azure-pipeline Mac testing fails unpredictably for some of the f2py
tests. The following tests are checked out from master to get the fixes.

- test_return_real.py
- test_semicolon_split.py
  • Loading branch information
charris committed Oct 21, 2018
commit 854c1f5aa6d01b4278d696ae91c8daadaa47b8d5
24 changes: 15 additions & 9 deletions numpy/f2py/tests/test_return_real.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import division, absolute_import, print_function

import platform
import pytest

from numpy import array
Expand Down Expand Up @@ -52,6 +53,11 @@ def check_function(self, t):
pass



@pytest.mark.skipif(
platform.system() == 'Darwin',
reason="Prone to error when run with numpy/f2py/tests on mac os, "
"but not when run in isolation")
class TestCReturnReal(TestReturnReal):
suffix = ".pyf"
module_name = "c_ext_return_real"
Expand Down Expand Up @@ -85,9 +91,9 @@ class TestCReturnReal(TestReturnReal):
"""

@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):
Expand Down Expand Up @@ -140,9 +146,9 @@ class TestF77ReturnReal(TestReturnReal):
"""

@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):
Expand Down Expand Up @@ -199,6 +205,6 @@ class TestF90ReturnReal(TestReturnReal):
"""

@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))
13 changes: 9 additions & 4 deletions numpy/f2py/tests/test_semicolon_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
from . import util
from numpy.testing import assert_equal

@pytest.mark.skipif(
platform.system() == 'Darwin',
reason="Prone to error when run with numpy/f2py/tests on mac os, "
"but not when run in isolation")
class TestMultiline(util.F2PyTest):
suffix = ".pyf"
module_name = "multiline"
Expand All @@ -26,13 +30,14 @@ class TestMultiline(util.F2PyTest):
end python module {module}
""".format(module=module_name)

@pytest.mark.skipif(platform.system() == 'Darwin',
reason="Prone to error when run with "
"numpy/f2py/tests on mac os, "
"but not when run in isolation")
def test_multiline(self):
assert_equal(self.module.foo(), 42)


@pytest.mark.skipif(
platform.system() == 'Darwin',
reason="Prone to error when run with numpy/f2py/tests on mac os, "
"but not when run in isolation")
class TestCallstatement(util.F2PyTest):
suffix = ".pyf"
module_name = "callstatement"
Expand Down