summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests/test_regression.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-12-05 16:30:05 -0700
committerGitHub <noreply@github.com>2021-12-05 16:30:05 -0700
commitd14d2c359fcbd499b73d254f0c20dd1a884ff9a3 (patch)
tree81edd1df081824acf385c12acafae65c1c381a9e /numpy/f2py/tests/test_regression.py
parent1bef412560293e67f9cf8c4e7b20a904c46ce41d (diff)
parent90e20e58eda7547678c6d2a4c121b0317de9c74d (diff)
downloadnumpy-d14d2c359fcbd499b73d254f0c20dd1a884ff9a3.tar.gz
Merge pull request #20479 from HaoZeke/f2pyTestPath
TST,STY: Clean up F2PY tests for pathlib.Path
Diffstat (limited to 'numpy/f2py/tests/test_regression.py')
-rw-r--r--numpy/f2py/tests/test_regression.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/numpy/f2py/tests/test_regression.py b/numpy/f2py/tests/test_regression.py
index b91499e4a..682b9e98c 100644
--- a/numpy/f2py/tests/test_regression.py
+++ b/numpy/f2py/tests/test_regression.py
@@ -7,13 +7,9 @@ from numpy.testing import assert_, assert_raises, assert_equal, assert_string_eq
from . import util
-def _path(*a):
- return os.path.join(*((os.path.dirname(__file__),) + a))
-
-
class TestIntentInOut(util.F2PyTest):
# Check that intent(in out) translates as intent(inout)
- sources = [_path('src', 'regression', 'inout.f90')]
+ sources = [util.getpath("tests", "src", "regression", "inout.f90")]
@pytest.mark.slow
def test_inout(self):
@@ -30,18 +26,22 @@ class TestIntentInOut(util.F2PyTest):
class TestNumpyVersionAttribute(util.F2PyTest):
# Check that th attribute __f2py_numpy_version__ is present
# in the compiled module and that has the value np.__version__.
- sources = [_path('src', 'regression', 'inout.f90')]
+ sources = [util.getpath("tests", "src", "regression", "inout.f90")]
@pytest.mark.slow
def test_numpy_version_attribute(self):
# Check that self.module has an attribute named "__f2py_numpy_version__"
- assert_(hasattr(self.module, "__f2py_numpy_version__"),
- msg="Fortran module does not have __f2py_numpy_version__")
+ assert_(
+ hasattr(self.module, "__f2py_numpy_version__"),
+ msg="Fortran module does not have __f2py_numpy_version__",
+ )
# Check that the attribute __f2py_numpy_version__ is a string
- assert_(isinstance(self.module.__f2py_numpy_version__, str),
- msg="__f2py_numpy_version__ is not a string")
+ assert_(
+ isinstance(self.module.__f2py_numpy_version__, str),
+ msg="__f2py_numpy_version__ is not a string",
+ )
# Check that __f2py_numpy_version__ has the value numpy.__version__
assert_string_equal(np.__version__, self.module.__f2py_numpy_version__)
@@ -50,6 +50,5 @@ class TestNumpyVersionAttribute(util.F2PyTest):
def test_include_path():
incdir = np.f2py.get_include()
fnames_in_dir = os.listdir(incdir)
- for fname in ('fortranobject.c', 'fortranobject.h'):
+ for fname in ("fortranobject.c", "fortranobject.h"):
assert fname in fnames_in_dir
-