Buckets:
| import textwrap | |
| import pytest | |
| from numpy.testing import IS_PYPY | |
| from . import util | |
| class TestModuleFilterPublicEntities(util.F2PyTest): | |
| sources = [ | |
| util.getpath( | |
| "tests", "src", "modules", "gh26920", | |
| "two_mods_with_one_public_routine.f90" | |
| ) | |
| ] | |
| # we filter the only public function mod2 | |
| only = ["mod1_func1", ] | |
| def test_gh26920(self): | |
| # if it compiles and can be loaded, things are fine | |
| pass | |
| class TestModuleWithoutPublicEntities(util.F2PyTest): | |
| sources = [ | |
| util.getpath( | |
| "tests", "src", "modules", "gh26920", | |
| "two_mods_with_no_public_entities.f90" | |
| ) | |
| ] | |
| only = ["mod1_func1", ] | |
| def test_gh26920(self): | |
| # if it compiles and can be loaded, things are fine | |
| pass | |
| class TestModuleDocString(util.F2PyTest): | |
| sources = [util.getpath("tests", "src", "modules", "module_data_docstring.f90")] | |
| def test_module_docstring(self): | |
| assert self.module.mod.__doc__ == textwrap.dedent( | |
| """\ | |
| i : 'i'-scalar | |
| x : 'i'-array(4) | |
| a : 'f'-array(2,3) | |
| b : 'f'-array(-1,-1), not allocated\x00 | |
| foo()\n | |
| Wrapper for ``foo``.\n\n""" | |
| ) | |
| class TestModuleAndSubroutine(util.F2PyTest): | |
| module_name = "example" | |
| sources = [ | |
| util.getpath("tests", "src", "modules", "gh25337", "data.f90"), | |
| util.getpath("tests", "src", "modules", "gh25337", "use_data.f90"), | |
| ] | |
| def test_gh25337(self): | |
| self.module.data.set_shift(3) | |
| assert "data" in dir(self.module) | |
| class TestUsedModule(util.F2PyTest): | |
| module_name = "fmath" | |
| sources = [ | |
| util.getpath("tests", "src", "modules", "use_modules.f90"), | |
| ] | |
| def test_gh25867(self): | |
| compiled_mods = [x for x in dir(self.module) if "__" not in x] | |
| assert "useops" in compiled_mods | |
| assert self.module.useops.sum_and_double(3, 7) == 20 | |
| assert "mathops" in compiled_mods | |
| assert self.module.mathops.add(3, 7) == 10 | |
Xet Storage Details
- Size:
- 2.3 kB
- Xet hash:
- 2850a5b1f124983555c01763d9e745c92b6f81d34418be5db052d78b541d516a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.