test_abstract_interface.py 809 B

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