summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests
Commit message (Collapse)AuthorAgeFilesLines
* TST: Make test suite work in FIPS (140-2) ModeNikola Forró2020-10-291-2/+0
| | | | | | | | | Tests using MD5 algorithms fail in FIPS Mode because MD5 is not FIPS compliant. Replace MD5 with SHA256 to overcome that. Signed-off-by: Nikola Forró <nforro@redhat.com>
* BUG: f2py incorrectly translates dimension declarations.Ian Thomas2020-10-271-0/+22
| | | | | | | | | | | | | | In fortran functions passed to f2py, calculations that occur in the dimensions of array declarations are interpreted as floats. Valid fortran requires integers. Problem only occurs with fortran functions not subroutines as only for the former does f2py generate fortran wrapper code that fails to compile. Relevant code is in numpy.f2py.crackfortran.getlincoef(), which calculates and returns the coefficients to getarrlen() for writing to the fortran wrapper code. Fixes gh-8062.
* Added textwrap.dedent to test.MelissaWM2020-09-261-2/+10
|
* Fixing tests for pypy and win.MelissaWM2020-09-241-2/+8
|
* BUG: Fixes module data docstrings.MelissaWM2020-09-244-1/+29
| | | | Fixes gh-15325
* Merge branch 'master' into cleanup-LongEric Wieser2020-08-241-13/+8
|\
| * MAINT: Remove uses of PyString_FromString.Charles Harris2020-08-191-13/+8
| | | | | | | | | | | | | | | | We no longer need to use the compatibility function after dropping support for Python 2.7. In some cases unicode was the correct string type rather than the bytes of the compatibility version and bugs in the array `__complex__` and array `__array_interface__` methods have been fixed by changing that.
* | MAINT: Replace PyInt macros with their PyLong replacementEric Wieser2020-08-241-4/+4
|/ | | | Unlike the others, PyInt_Check has a special meaning distinc from PyLong_Check, so only the places where the difference doesn't matter have been updated here.
* add __f2py_numpy_version__ attributeSturla Molden2020-06-171-1/+21
|
* TST: f2py: add test for callback threadsafetyPauli Virtanen2020-06-071-0/+50
|
* MNT: support python 3.10Thomas A Caswell2020-05-291-1/+1
| | | | | | | | | | | | In https://github.com/python/cpython/pull/20290 CPython changed `Py_TYPE` from a macro to an inline function. This requires a code change to us `Py_SET_TYPE` instead when using `Py_TYPE()` as a lvalue in c code. In https://github.com/python/cpython/pull/20429 CPython changed `Py_SIZE` from a macro to an inline function. This requires a code change to us `Py_SET_SIZE` instead of using `Py_SIZE` as a lvalue in c code.
* MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-264-8/+1
| | | | | types (#15816) Cleanup from the dropping of python 2
* Merge pull request #15781 from dcaliste/publicMatti Picus2020-03-261-0/+53
|\ | | | | BUG: don't add 'public' or 'private' if the other one exists
| * BUG: don't add 'public' or 'private' if the other one existsDamien Caliste2020-03-261-0/+53
| | | | | | | | | | | | Currently, setting 'public' or 'private' attribute is adding one even if the other one already exists because of the else: part that is always appending.
* | md5 module is deprecated since python 2.5Roman Yurchak2020-03-241-4/+1
|/
* BUG, TST: fix f2py for PyPy, skip one test for PyPy (#15750)Matti Picus2020-03-187-34/+28
| | | * BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
* MAINT: cleanup unused imports; avoid redefinition of importsMike Taves2020-02-062-3/+0
| | | | | | | * Cleanup unused imports (F401) of mostly standard Python modules, or some internal but unlikely referenced modules * Where internal imports are potentially used, mark with noqa * Avoid redefinition of imports (F811)
* STY: use `with open` when possibleSeth Troisi2020-01-211-3/+2
|
* MAINT: Remove sys.version checks in testsSeth Troisi2020-01-151-2/+0
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-053-7/+7
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* Merge pull request #15232 from sethtroisi/remove_python3_part3Matti Picus2020-01-041-2/+0
|\ | | | | MAINT: Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX
| * Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEXSeth Troisi2020-01-031-2/+0
| |
* | Merge pull request #14376 from jdufresne/futureSebastian Berg2020-01-0321-43/+0
|\ \ | |/ |/| MAINT: Remove unnecessary 'from __future__ import ...' statements
| * MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-0321-43/+0
| | | | | | | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* | MAINT: Remove Python2 specific C module setup (gh-15231)Seth Troisi2020-01-031-11/+1
|/ | | | | Dropping the support for python 2, the difference in module setup do not have to be accounted for anymore. This removes the macros and ifdef's related to module setup code and python 2 support.
* TST: f2py: fix race condition in f2py test _get_compiler_statusPauli Virtanen2019-12-141-3/+9
| | | | | | Distutils code needs to run in different temporary directories, probably because they create `_configtest.c` files for compiler detection in the current directory.
* ENH: f2py: add --f2cmap option for specifying the name of .f2py_f2cmapPauli Virtanen2019-12-142-6/+27
| | | | | | | | | | | | | Previously, f2py loaded the type mappings from a file ``.f2py_f2cmap`` in current directory, at import time. Make the file name customizable by adding a ``--f2cmap`` command line option, and postpone loading the file to f2py.run_main(). Moreover, restore the default type mapping in f2py.run_main() before loading the customizations, so that multiple calls to f2py.run_main() do not interfere with each other. (For example, numpy.distutils calls f2py multiple times in the same process.)
* MAINT: fixes from reviewmattip2019-12-031-3/+4
|
* BUG: add endfunction, endsubroutine to valid fortran end wordsmattip2019-12-031-0/+39
|
* BUG: Further, followup f2py reference count fixesSebastian Berg2019-08-193-9/+28
| | | | | | | | Note that the extension module dict seems to be never dereferenced (there is an additional reference to it kept around somewhere). This reference seems to part of the C python module loading (possibly intentionally), and I could not find how to remove it or where it originates from.
* BUG: General fixes to f2py reference counts (dereferencing)Sebastian Berg2019-08-191-56/+64
|
* TEST: update for PyPymattip2019-04-171-1/+2
|
* MAINT: Use textwrap.dedent in f2py testsEric Wieser2019-04-103-43/+42
| | | | Don't touch the fortran files, since indentation is signficant there and it makes things more error-prone
* BUG: Fix testing of f2py.compile from strings.Charles Harris2019-01-202-14/+17
| | | | | | | The test should not be run if there is no Fortran compiler. This PR moves it to `numpy/f2py/tests/test_compile_function.py`, which is appropriate for the test and a place where the presence of the needed compilers is already checked for.
* BUG, DOC: test, fix that f2py.compile accepts str and bytes, rework docsmattip2019-01-201-0/+14
|
* MAINT: Review F401,F841,F842 flake8 errors (unused variables and imports) ↵Roman Yurchak2018-12-065-10/+1
| | | | | | | | | | | | (#12448) * Review F401,F841,F842 flake8 errors (unused variables, imports) * Review comments * More tests in test_installed_npymath_ini * Review comments
* TST, MAINT: Skip some f2py tests on Mac.Charles Harris2018-10-072-4/+15
| | | | | | There is a not yet understood problem in testing f2py C modules (*.pyf) files on the Mac that manifests as erratic module import failures.' This disables those tests until we can figure out what the problem is.
* TST: add macos azure testing to CI.Tyler Reddy2018-09-281-0/+7
|
* MAINT: remove duplicate importsmattip2018-09-261-2/+0
|
* Merge pull request #11894 from QuLogic/f2py-test-parametrizeCharles Harris2018-09-227-47/+48
|\ | | | | TST: Parametrize f2py tests.
| * TST: Use fixture around f2py shared memory tests.Elliott Sales de Andrade2018-09-061-11/+9
| | | | | | | | | | This allows to parametrize the entire class without having to do any trickery with eval.
| * TST: Parametrize f2py tests.Elliott Sales de Andrade2018-09-066-36/+39
| |
* | Merge pull request #12014 from tylerjereddy/issue_12013_pytest_skipCharles Harris2018-09-212-7/+8
|\ \ | | | | | | TST: prefer pytest.skip() over SkipTest
| * | BUG: Fix missing pytest import.Charles Harris2018-09-211-0/+1
| | | | | | | | | `test_array_from_pyobj.py` needs to import pytest.
| * | TST: prefer pytest.skip() over SkipTestTyler Reddy2018-09-212-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * replace most usage of SkipTest() with pytest.skip() * where possible, we avoid use of the standard library SkipTest because unittest skipping is routed through the pytest nose compatibility layer in that scenario, which can prevent an easy trace back to the test line where the skip occurred
* | | BUG: Fix f2py test_compile_function.py tests.Charles Harris2018-09-211-74/+61
| | | | | | | | | | | | | | | | | | The tests were failing on platforms without a fortran compiler as that was not being checked for. Add that check among others and clean up the test functions a bit.
* | | TST, MAINT: Separate f2py compile function testing into own fileCharles Harris2018-09-202-105/+125
|/ / | | | | | | | | | | | | Create new file `test_compile_function.py` for the test, transferring the content from `test_quoted_characters.py` where it was before. The tricky part here is maintaining the history in both files after the move.
* | MAINT: remove exec_command() from f2py initTyler Reddy2018-09-181-0/+110
|/ | | | | * replaced the usage of exec_command() in the f2py init with standard library equivalent
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-0617-77/+19
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* TST: Switch to using pytest markersCharles Harris2018-04-0417-61/+88
| | | | | | | | | | | Use standard pytest markers everywhere in the numpy tests. At this point there should be no nose dependency. However, nose is required to test the legacy decorators if so desired. At this point, numpy test cannot be run in the way with runtests, rather installed numpy can be tested with `pytest --pyargs numpy` as long as that is not run from the repo. Run it from the tools directory or some such.