summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests/util.py
Commit message (Collapse)AuthorAgeFilesLines
* CI: Rebase numpy DLLs in runtests.py.DWesl2023-01-301-1/+2
| | | | | This assumes NumPy is rebased before tests run, but does not assume the locations are in the database.
* TST: Rebase F2Py-built extension modules.DWesl2023-01-291-0/+19
| | | | | Also adjust CI so they don't immediately collide with NumPy. I forgot to do that last time, which caused problems.
* Revert "FIX: Add glob import for test module rebase."DWesl2023-01-271-1/+0
| | | | This reverts commit 33709afdbbc47b7adb7dd06a730246d8c02f724f.
* Revert "TST: Rebase F2Py test modules on Cygwin."DWesl2023-01-271-16/+0
| | | | This reverts commit 608864613b801b9c85573186a9d07eeac5e7e465.
* FIX: Add glob import for test module rebase.DWesl2023-01-271-0/+1
| | | | Forgot to check this earlier.
* TST: Rebase F2Py test modules on Cygwin.DWesl2023-01-261-0/+16
| | | | Let's see if this fixes the 8-50 fork failures.
* TST: Skip tests that are not currently supported in wasmHood Chatham2022-11-111-1/+4
|
* TST: Rename setup to setup_method in f2py utils (inherited into Tests)Sebastian Berg2022-10-271-1/+1
|
* ENH: Support character string arraysPearu Peterson2022-06-051-2/+8
| | | | | | | | | | | | | | | | TST: added test for issue #18684 ENH: f2py opens files with correct encoding, fixes #635 TST: added test for issue #6308 TST: added test for issue #4519 TST: added test for issue #3425 ENH: Implement user-defined hooks support for post-processing f2py data structure. Implement character BC hook. ENH: Add support for detecting utf-16 and utf-32 encodings.
* TST: Handle compiler checks for PYFRohit Goswami2022-05-281-4/+9
|
* MAINT: Skip F2PY tests without Fortran compilersRohit Goswami2022-05-271-4/+4
|
* MAINT: Update to better python stylesRohit Goswami2021-12-051-20/+19
| | | | Co-authored-by: Pearu Peterson <pearu.peterson@gmail.com>
* MAINT: Rework whitespace to pass PR checksRohit Goswami2021-12-051-41/+70
| | | | Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
* TST,STY: Use a context manager for F2PY functionsRohit Goswami2021-12-031-2/+12
|
* TST,STY: Clean up F2PY tests for pathlib.PathRohit Goswami2021-12-031-2/+13
|
* MAINT: remove unused importsAlessia Marcolini2021-10-081-3/+0
|
* MAINT: revise OSError aliases (IOError, EnvironmentError)Mike Taves2021-09-021-1/+1
|
* 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>
* md5 module is deprecated since python 2.5Roman Yurchak2020-03-241-4/+1
|
* STY: use `with open` when possibleSeth Troisi2020-01-211-3/+2
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-1/+1
| | | | | | | 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.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* 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-141-6/+5
| | | | | | | | | | | | | 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.)
* BUG: Further, followup f2py reference count fixesSebastian Berg2019-08-191-6/+8
| | | | | | | | 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.
* MAINT: Use textwrap.dedent in f2py testsEric Wieser2019-04-101-36/+36
| | | | Don't touch the fortran files, since indentation is signficant there and it makes things more error-prone
* MAINT: Review F401,F841,F842 flake8 errors (unused variables and imports) ↵Roman Yurchak2018-12-061-3/+1
| | | | | | | | | | | | (#12448) * Review F401,F841,F842 flake8 errors (unused variables, imports) * Review comments * More tests in test_installed_npymath_ini * Review comments
* TST: prefer pytest.skip() over SkipTestTyler Reddy2018-09-211-5/+5
| | | | | | | | | | | | * 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
* TST: Switch to using pytest markersCharles Harris2018-04-041-2/+5
| | | | | | | | | | | 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.
* TST: util: update documentationxoviat2017-09-091-1/+1
|
* TST: fix failures:xoviat2017-09-041-4/+5
| | | | | | 1. fail tests related to DLL load failure as they were previously untested. 2. fix have_compiler to return false on old compilers 3. xfail some tests that were not working on old Python versions.
* TST: Remove unittest dependencies in numpy/f2py/tests.Charles Harris2017-07-241-1/+1
|
* MAINT: Remove asbytes where a b prefix would sufficeEric Wieser2017-03-251-1/+1
| | | | | | | | Since we only need to support python 2, we can remove any case where we just pass a single string literal and use the b prefix instead. What we can't do is transform asbytes("tests %d" % num), because %-formatting fails on bytes in python 3.x < 3.5.
* MAINT: Simplify some tests using temppath context manager.Charles Harris2015-12-261-20/+12
| | | | | | | | | | | | | | | | | | | | | | | | This replaces code of the pattern ``` fd, name = tempfile.mkstemp(...) os.close(fd) try: do stuff with name finally: os.remove(name) ``` with ``` with temppath() as name: do stuff with name ``` A few more complicated cases are also handled. The remains some particularly gnarly code the could probably be refactored to use temppath, but that is a more demanding project.
* ENH: testing: add SkipTest and KnownFailureExceptionEvgeni Burovski2015-11-161-5/+4
| | | | | | | | * use SkipTest in numpy tests instead of importing it from nose * add a KnownFailureException as an alias for KnownFailureTest (the former is preferred, but the latter is kept for backcompat) * rename the KnownFailure nose plugin into KnownFailurePlugin, and keep the old name for backcompat
* STY: PEP8 fixes in numpy/f2py/tests.Charles Harris2015-07-251-2/+16
|
* 2to3: Apply `print` fixer.Charles Harris2013-04-061-1/+1
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Use absolute imports.Charles Harris2013-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* 2to3: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-271-1/+1
| | | | | | | | | | | | | | | In python3 range is an iterator and `xrange` has been removed. This has two consequence for code: 1) Where a list is needed `list(range(...))` must be used. 2) `xrange` must be replaced by `range` Both of these changes also work in python2 and this patch makes both. There are three places fixed that do not need it, but I left them in so that the result would be `xrange` clean. Closes #3092
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+1
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* 2to3: Use modern exception syntax.Charles Harris2013-02-261-1/+1
| | | | Example: except ValueError,msg: -> except ValueError as msg:
* Fix assumed shape support for routines that use modules. Improved ↵Pearu Peterson2011-02-271-0/+6
| | | | .f2py_f2cmap messages.
* BUG: f2py: fix F90 detection in the testsPauli Virtanen2010-03-061-2/+2
|
* 3K: f2py: make f2py run far enough to produce output files (they don't ↵Pauli Virtanen2010-03-061-4/+4
| | | | compile yet, though, as the C code is not Py3 compatible)
* ENH: f2py: convert test suite to Nose formPauli Virtanen2010-03-061-0/+346
Rewrite F2Py's test suite, so that it is run as a part of Numpy's tests. These tests require compiling extension modules on-the-fly, so I added a small helper module for that.