test_common.py 802 B

12345678910111213141516171819202122232425
  1. import os
  2. import sys
  3. import pytest
  4. import numpy as np
  5. from . import util
  6. from numpy.testing import assert_array_equal
  7. def _path(*a):
  8. return os.path.join(*((os.path.dirname(__file__),) + a))
  9. class TestCommonBlock(util.F2PyTest):
  10. sources = [_path('src', 'common', 'block.f')]
  11. @pytest.mark.skipif(sys.platform=='win32',
  12. reason='Fails with MinGW64 Gfortran (Issue #9673)')
  13. def test_common_block(self):
  14. self.module.initcb()
  15. assert_array_equal(self.module.block.long_bn,
  16. np.array(1.0, dtype=np.float64))
  17. assert_array_equal(self.module.block.string_bn,
  18. np.array('2', dtype='|S1'))
  19. assert_array_equal(self.module.block.ok,
  20. np.array(3, dtype=np.int32))