PATH:
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
numpy
/
f2py
/
tests
import os import pytest import platform from numpy.f2py.crackfortran import ( _selected_int_kind_func as selected_int_kind, _selected_real_kind_func as selected_real_kind, ) from . import util class TestKind(util.F2PyTest): sources = [util.getpath("tests", "src", "kind", "foo.f90")] def test_int(self): """Test `int` kind_func for integers up to 10**40.""" selectedintkind = self.module.selectedintkind for i in range(40): assert selectedintkind(i) == selected_int_kind( i ), f"selectedintkind({i}): expected {selected_int_kind(i)!r} but got {selectedintkind(i)!r}" def test_real(self): """ Test (processor-dependent) `real` kind_func for real numbers of up to 31 digits precision (extended/quadruple). """ selectedrealkind = self.module.selectedrealkind for i in range(32): assert selectedrealkind(i) == selected_real_kind( i ), f"selectedrealkind({i}): expected {selected_real_kind(i)!r} but got {selectedrealkind(i)!r}" @pytest.mark.xfail(platform.machine().lower().startswith("ppc"), reason="Some PowerPC may not support full IEEE 754 precision") def test_quad_precision(self): """ Test kind_func for quadruple precision [`real(16)`] of 32+ digits . """ selectedrealkind = self.module.selectedrealkind for i in range(32, 40): assert selectedrealkind(i) == selected_real_kind( i ), f"selectedrealkind({i}): expected {selected_real_kind(i)!r} but got {selectedrealkind(i)!r}"
[-] test_assumed_shape.py
[open]
[-] test_mixed.py
[open]
[-] test_quoted_character.py
[open]
[+]
src
[-] test_abstract_interface.py
[open]
[+]
..
[-] test_f2cmap.py
[open]
[-] test_callback.py
[open]
[-] test_symbolic.py
[open]
[-] test_semicolon_split.py
[open]
[+]
__pycache__
[-] test_size.py
[open]
[-] test_value_attrspec.py
[open]
[-] test_crackfortran.py
[open]
[-] test_f2py2e.py
[open]
[-] test_return_real.py
[open]
[-] test_return_integer.py
[open]
[-] test_compile_function.py
[open]
[-] test_regression.py
[open]
[-] util.py
[open]
[-] test_module_doc.py
[open]
[-] test_return_logical.py
[open]
[-] test_docs.py
[open]
[-] test_kind.py
[open]
[-] test_string.py
[open]
[-] test_return_character.py
[open]
[-] __init__.py
[open]
[-] test_block_docstring.py
[open]
[-] test_return_complex.py
[open]
[-] test_array_from_pyobj.py
[open]
[-] test_character.py
[open]
[-] test_common.py
[open]
[-] test_parameter.py
[open]