codekingpro/portable-devtools
115k
1import pytest
2
3from numpy.f2py import crackfortran
4from numpy.testing import IS_WASM
5
6from . import util
7
8
9@pytest.mark.skipif(IS_WASM, reason="Cannot start subprocess")
10@pytest.mark.slow
11class TestAbstractInterface(util.F2PyTest):
12 sources = [util.getpath("tests", "src", "abstract_interface", "foo.f90")]
13
14 skip = ["add1", "add2"]
15
16 def test_abstract_interface(self):
17 assert self.module.ops_module.foo(3, 5) == (8, 13)
18
19 def test_parse_abstract_interface(self):
20 # Test gh18403
21 fpath = util.getpath("tests", "src", "abstract_interface",
22 "gh18403_mod.f90")
23 mod = crackfortran.crackfortran([str(fpath)])
24 assert len(mod) == 1
25 assert len(mod[0]["body"]) == 1
26 assert mod[0]["body"][0]["block"] == "abstract interface"
27 