| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
There a resetwarnings() call, so need to add back these filters.
|
| |
|
|
|
|
|
|
|
| |
The --cover-inclusive argument means that coverage.py tries to include every
single .py file in the source tree in the coverage report. This leads to test
errors, because it tries to import files like setupscons.py (which will of
course directly fail for anyone not having numscons installed).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Warnings show up when a directory with the same name as a Python file or
compiled extension is seen which doesn't have an __init__.py file in it. This
situation is very common, for example in SciPy where many extensions are
created from source files located under a directory with the same name.
This filter is located within a context manager, so only filters when running
tests.
|
| |
|
| |
|
|
|
|
|
| |
Also document that behavior has to be switched for a release, and remove
comments on turning on deprecation warnings that don't apply anymore.
|
| |
|
|
|
|
|
|
| |
The default is set to (RuntimeWarning, DeprecationWarning), and
the intent is to leave it as this on master, but change it to ()
immediately after branching for 1.7 in that branch.
|
|
|
|
| |
RegressionWarning
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are various docstrings show examples of how to run the tests, and
give example test output. Obviously the test output changes, and
running the doctests for the testing package:
import numpy.testing as npt
npt.test(doctests=True)
will cause several large sets of tests to be run in the rest of the
tree. So I skipped these.
|
|
|
|
|
|
|
| |
The doctesting tests were in the code file, and (for me) rather
difficult to run without running lots of other tests. With this change
you can run the doctest tests in isolation by executing the
test_doctesting.py file.
|
|
|
|
|
|
|
| |
Refactor ``prepare_test_args`` method to make it easier for subclasses
to adapt its behavior. This should make it easier for nipy and other
projects to use the numpy testing machinery without wholesale copies
into their source trees.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We previously had a baroque inheritance scheme to deal with the case
where the user had normal nose doctests enabled in their environment.
However, this scheme didn't deal with bench() routine, and was
complicated. This commit uses a null Unplugger plugin to pull the
doctest plugin off the nose configuration after it has been initialized.
We can use this for bench() and test(), and it allows the doctest module
to be enabled (by the user environment) and then thrown away.
Also rejigged the docstrings and removed the automated docstring
addition as the docstrings have already been copied and adapted in the
code.
|
|
|
|
| |
assert in non-testing files that should be checked for correctness.
|
| |
|
|
|
|
| |
confusing than useful
|
|
|
|
| |
be nose-compatible
|
| |
|
| |
|
| |
|
|
|
|
| |
robust
|
|
|
|
| |
Varoquaux)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- ParametricTestCase
- The following arguments from numpy.testing.Tester.test(): level,
verbosity,
all, sys_argv, testcase_pattern
- Path manipulation functions: set_package_path, set_local_path,
restore_path
- NumpyTestCase, NumpyTest
Also separated testing parameter setup from NoseTester.test into
NoseTester.prepare_test_args for use in a utility script for valgrind
testing (see NumPy ticket #784).
|
| |
|
|
|
|
|
| |
which allows flagging tests as known failures rather than skips.
Updated test_umath to use knownfailureif.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
available in an installed NumPy.
Display system configuration information when benchmarks are run.
|
| |
|
|
|
|
|
|
|
| |
Added numpy.testing.print_assert_equal, to allow removing the multiple
identical implementations of this function in SciPy tests.
Display version info for NumPy, Python, and nose (and SciPy when running SciPy
tests), in a manner similar to the original test framework.
|
|
|
|
|
|
| |
nose.plugins.builtins imports.
If --with-doctest is included in extra_argv, remove it and use the NumPy doctester
instead.
|
|
|
|
| |
Fixed __import__ calls for Python 2.4 (__import__ doesn't take keyword args in 2.4).
|
|
|
|
|
|
| |
builtin plugin.
Removed decorators for NoseTester methods.
|
|
|
|
|
|
| |
both
testers" when test() is run multiple times.
|
|
|
|
|
| |
Added utils.assert_raises (uses the function from nose).
Wrapped text for test() deprecation warning.
|
|
|
|
|
|
|
|
|
| |
__file__ = '__main__' to doctest context to allow the updated test to
run correctly.
Added setupscons.py and setup.py to the list of files to ignore when
looking for doctests.
Cleaned up docstrings for readability.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Remove unnecessary "import re".
Limit doctest execution environment to "import numpy as np".
Save and restore print options after each doctest (to clean up after some doctests that change
them).
Enable ellipsis for all doctests.
Remove parameter to NumpyDocTestCase constructor that was specific to nose 0.11.
Monkeypatch wantFile of doctest plugin to skip Python files related to the build process
(scons_support.py and generate_numpy_api.py).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Adding "#random" to an expected output line will skip the comparison with actual
output (but the command is still executed).
- All doctests have the numpy module available in their execution context as "np".
- Whitespace normalization is enabled for all doctests executed via nose.
Doctests added to check that the above behaviors are available.
Nose version check/message cleanup.
Fix typo in doctest for NoseTester (was still referencing scipy.testing).
Rewrapped comments/docstrings to 80 columns.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
to NumPy
(prevent import of nose until actual execution of tests). Restored
"raises" function to numpy/testing/utils.py until it can be replaced with the function of
the same name from nose.tools after the lazy import.
|
|
modules.
|