test_common.py 641 B

1234567891011121314151617181920
  1. import pytest
  2. import numpy as np
  3. from . import util
  4. @pytest.mark.slow
  5. class TestCommonBlock(util.F2PyTest):
  6. sources = [util.getpath("tests", "src", "common", "block.f")]
  7. def test_common_block(self):
  8. self.module.initcb()
  9. assert self.module.block.long_bn == np.array(1.0, dtype=np.float64)
  10. assert self.module.block.string_bn == np.array("2", dtype="|S1")
  11. assert self.module.block.ok == np.array(3, dtype=np.int32)
  12. class TestCommonWithUse(util.F2PyTest):
  13. sources = [util.getpath("tests", "src", "common", "gh19161.f90")]
  14. def test_common_gh19161(self):
  15. assert self.module.data.x == 0