F2PY test suite
F2PY’s test suite is present in the directory numpy/f2py/tests. Its aim
is to ensure that Fortran language features are correctly translated to Python.
For example, the user can specify starting and ending indices of arrays in
Fortran. This behaviour is translated to the generated CPython library where
the arrays strictly start from 0 index.
The directory of the test suite looks like the following:
./tests/
├── __init__.py
├── src
│ ├── abstract_interface
│ ├── array_from_pyobj
│ ├── // ... several test folders
│ └── string
├── test_abstract_interface.py
├── test_array_from_pyobj.py
├── // ... several test files
├── test_symbolic.py
└── util.pyFiles starting with test_ contain tests for various aspects of f2py from parsing
Fortran files to checking modules’ documentation. src directory contains the
Fortran source files upon which we do the testing. contains utility
functions for building and importing Fortran modules during test time using a
temporary location.