summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test__datasource.py
Commit message (Collapse)AuthorAgeFilesLines
* TST,MAINT: Replace most `setup` with `setup_method` (also teardown)Sebastian Berg2022-10-271-12/+12
| | | | | | | | In some cases, the replacement is clearly not what is intended, in those (where setup was called explicitly), I mostly renamed `setup` to `_setup`. The `test_ccompile_opt` is a bit confusing, so left it right now (this will probably fail)
* MAINT: revise OSError aliases (IOError, EnvironmentError)Mike Taves2021-09-021-3/+3
|
* MAINT: Clean up, mostly unused imports.Warren Weckesser2020-01-231-4/+1
|
* MAINT: Remove sys.version checks in testsSeth Troisi2020-01-151-26/+3
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-6/+6
| | | | | | | 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.
* BUG: improve DataSource __del__Tyler Reddy2018-11-131-0/+15
| | | | | | | | * DataSource __del__ could raise an AttributeError if __init__ failed for any reason; __del__ now gracefully handles the case where __init__ fails, as happens in the internals of refguide_check when handling DataSource with an unexpected kwarg
* TST: prefer pytest.skip() over SkipTestTyler Reddy2018-09-211-4/+4
| | | | | | | | | | | | * 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
* Merge pull request #11715 from QuLogic/no-networkCharles Harris2018-08-171-2/+2
|\ | | | | TST: Fix urlopen stubbing.
| * TST: Fix urlopen stubbing.Elliott Sales de Andrade2018-08-151-2/+2
| | | | | | | | | | setup/teardown doesn't work, but setup_module/teardown_module does, at least in pytest.
* | BUG: Fix regression in loadtxt for bz2 text files in Python 2.Charles Harris2018-08-101-1/+22
|/ | | | | | | | | | | Text bz2 files are not well supported in Python2, and, following the NumPy upgrade in text handling, loadtxt was raising an error when they were detected. This led to problems for those few who were using such files. This patch is a quick fix that issues a RuntimeWarning, then opens those files under the assumption that they are latin1 encoded. Caveat emptor. Closes #11633.
* MAINT: Remove all uses of run_module_suite.Charles Harris2018-04-061-7/+1
| | | | | That function is nose specific and has not worked since `__init__` files were added to the tests directories.
* TST: Remove unittest dependencies in numpy/lib/tests.Charles Harris2017-07-241-35/+35
|
* MAINT: Remove asbytes where a b prefix would sufficeEric Wieser2017-03-251-2/+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.
* ENH: testing: add SkipTest and KnownFailureExceptionEvgeni Burovski2015-11-161-5/+3
| | | | | | | | * 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 compliance for numpy/lib/tests.Charles Harris2014-07-311-1/+1
| | | | | | | The possibly controversial part of this is making the nested array value lists PEP8 compliant, as there is something to be said aligning the values for clarity. In the end, it seemed like the easiest thing to do was to make them PEP8 compliant. The eye can get used to that.
* MAINT: Fix problems noted by pyflakes in numpy/lib/tests.Charles Harris2014-07-311-3/+6
|
* STY: Make numpy/lib/test/*.py PEP8 compliant.Charles Harris2013-09-031-1/+13
| | | | | | | Run autopep8 over the test files in numpy/lib/test and make fixes to the result. Also remove Python5 workaround.
* 2to3: Apply urllib fixer.Charles Harris2013-04-141-6/+10
| | | | | | | | | | | Various functions have been moved around in the stdlib for Python 3, this fixes that up so that the code is valid in both Python 2 and Python 3. Note: monkey patching the stlib urlopen for testing looks a bit hokey to me, but I don't see an easier, more reliable way to do the test. Closes #3090.
* 2to3: Apply the `numliterals` fixer and skip the `long` fixer.Charles Harris2013-04-131-1/+1
| | | | | | | | | | | | | | | | | | | The numliterals fixer replaces the old style octal number like '01' by '0o1' removes the 'L' suffix. Octal values were previously mistakenly specified in some dates, those uses have been corrected by removing the leading zeros. Simply Removing the 'L' suffix should not be a problem, but in some testing code it looks neccesary, so in those places the Python long constructor is used instead. The 'long' type is no longer defined in Python 3. Because we need to have it defined for Python 2 it is added to numpy/compat/np3k.py where it is defined as 'int' for Python 3 and 'long' for Python 2. The `long` fixer then needs to be skipped so that it doesn't undo the good work. Closes #3074, #3067.
* 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: Apply `imports` fixer.Charles Harris2013-04-021-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The `imports` fixer deals with the standard packages that have been renamed, removed, or methods that have moved. cPickle -- removed, use pickle commands -- removed, getoutput, getstatusoutput moved to subprocess urlparse -- removed, urlparse moved to urllib.parse cStringIO -- removed, use StringIO or io.StringIO copy_reg -- renamed copyreg _winreg -- renamed winreg ConfigParser -- renamed configparser __builtin__ -- renamed builtins In the case of `cPickle`, it is imported as `pickle` when python < 3 and performance may be a consideration, but otherwise plain old `pickle` is used. Dealing with `StringIO` is a bit tricky. There is an `io.StringIO` function in the `io` module, available since Python 2.6, but it expects unicode whereas `StringIO.StringIO` expects ascii. The Python 3 equivalent is then `io.BytesIO`. What I have done here is used BytesIO for anything that is emulating a file for testing purposes. That is more explicit than using a redefined StringIO as was done before we dropped support for Python 2.4 and 2.5. Closes #3180.
* 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: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+2
| | | | | | | | 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:
* TST: clean up some ResourceWarnings from python 3.2.rgommers2011-03-021-5/+13
| | | | | Also make the sys.stdout temporary redirection in one of the tests a little more robust. That is still necessary, because np.who is very noisy.
* TST: replace assert with assert_rgommers2011-03-021-15/+15
|
* 3K: lib: Make _datasource and its tests Py3 compatible + slight cleanup of ↵Pauli Virtanen2010-02-201-1/+3
| | | | the code
* Removed unused imports.Alan McIntyre2008-09-091-3/+0
|
* ran reindentJarrod Millman2008-08-081-1/+0
|
* BUG: Correctly stub out urllib2.urlopen() for tests given the refactoring of ↵Robert Kern2008-07-031-3/+9
| | | | the local imports.
* BUG: need to create exceptions correctly.Robert Kern2008-07-031-9/+15
|
* Reduce numpy's import times by delaying a few time consuming imports to the ↵Robert Kern2008-07-031-1/+2
| | | | point of actual use and global instantiations of finfo. Thanks to David Cournapeau for tracking down and fixing the import part of the problem.
* Restore old test framework classes.Alan McIntyre2008-06-211-1/+2
| | | | | | | | | | | Added numpy.testing.run_module_suite to simplify "if __name__ == '__main__'" boilerplate code in test modules. Removed numpy/testing/pkgtester.py since it just consisted of an import statement after porting SciPy r4424. Allow numpy.*.test() to accept the old keyword arguments (but issue a deprecation warning when old arguments are seen). numpy.*.test() returns a test result object as before. Fixed typo in distutils doc.
* Switched to use nose to run tests. Added test and bench functions to all ↵Alan McIntyre2008-06-171-7/+7
| | | | modules.
* ran reindent in preparation for the 1.1 releaseJarrod Millman2008-04-201-3/+3
|
* Fixing #738: Even more careful drive letter handling. And make the tests ↵Pauli Virtanen2008-04-191-2/+2
| | | | actually pass on Windows.
* Fix bug #738 and add corresponding tests.Pauli Virtanen2008-04-191-4/+51
| | | | | | | | lib._datasource.DataSource.abspath now sanitizes path names more carefully, making sure that all file paths reside in destdir, also on Windows. (Where both '/' and os.sep function as path separators, as far as os.path.join is concerned.)
* Don't require gzip or bz2 until the actual functionality is requested.Robert Kern2008-04-171-2/+14
|
* Add datasource test file that didn't make it in the move from scipy.io to ↵chris.burns2008-02-121-0/+248
numpy.lib.