diff options
author | Rohit Goswami <rog32@hi.is> | 2021-11-28 06:06:28 +0000 |
---|---|---|
committer | Rohit Goswami <rog32@hi.is> | 2021-12-03 03:15:36 +0000 |
commit | 3c92ba281502393283caffe995c1a0662f2c9f84 (patch) | |
tree | 9e39a877980e00cafd995459d47383edaf78b13d /numpy/f2py/tests/test_abstract_interface.py | |
parent | 0e10696f55576441fd820279d9ec10cd9f2a4c5d (diff) | |
download | numpy-3c92ba281502393283caffe995c1a0662f2c9f84.tar.gz |
TST,STY: Clean up F2PY tests for pathlib.Path
Diffstat (limited to 'numpy/f2py/tests/test_abstract_interface.py')
-rw-r--r-- | numpy/f2py/tests/test_abstract_interface.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/numpy/f2py/tests/test_abstract_interface.py b/numpy/f2py/tests/test_abstract_interface.py index 936c1f7bc..41b7d21c4 100644 --- a/numpy/f2py/tests/test_abstract_interface.py +++ b/numpy/f2py/tests/test_abstract_interface.py @@ -1,3 +1,4 @@ +from pathlib import Path import textwrap from . import util from numpy.f2py import crackfortran @@ -50,16 +51,15 @@ class TestAbstractInterface(util.F2PyTest): def test_parse_abstract_interface(self, tmp_path): # Test gh18403 - f_path = tmp_path / "gh18403_mod.f90" - with f_path.open('w') as ff: - ff.write(textwrap.dedent("""\ - module test - abstract interface - subroutine foo() - end subroutine - end interface - end module test - """)) + f_path = Path(tmp_path / "gh18403_mod.f90") + f_path.write_text(textwrap.dedent("""\ + module test + abstract interface + subroutine foo() + end subroutine + end interface + end module test + """)) mod = crackfortran.crackfortran([str(f_path)]) assert len(mod) == 1 assert len(mod[0]['body']) == 1 |