| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Removes these files that were deprecated since 1.15.0:
- numpy/testing/decorators.py
- numpy/testing/noseclasses.py
- numpy/testing/nosetester.py
This also resolves a failure in the recently introduced tests
in `test_public_api.py` (see gh-14454). Closes gh-14566
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise the deprecation message is not that helpful as I have to dig
through the source to find out since when and whether conditional import
is necessary in my code. I may not have numpy on my dev machine (this
message was on CI). So it's one extra step for the consumer.
That's also for you, you have more chance of having consumer update
their code when they have more informations in the deprecation message,
so you can drop old code faster !
At least kudo to Charles Harris for including a comments just above,
that prevented me from having to git blame and go spelunking for knowing
which versions were or not affected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following modules have been moved or renamed and should not be
imported. This adds shim modules for the old names that issue a
DeprecationWarning on import.
* numpy/core/umath_tests.py
* numpy/testing/decorators.py
* numpy/testing/noseclasses.py
* numpy/testing/nosetester.py
* numpy/testing/utils.py
Closes #10845.
|
|
|
|
| |
The warning type is the second, not the first, argument.
|
|
|
|
|
| |
Downstream projects were importing directly from the testing modules
rather than from testing. Discourage this.
|
|
|
|
|
|
|
|
|
| |
This is to prepare for the switch to pytest.
* Rename `numpy/testing/nose_tools` to `numpy/testing/_private`.
* Redirect imports as needed.
* Copy `_testutils.py` from scipy to `numpy/testing/_private`.
* Rename `_testutils.py` to `_pytester.py` and remove unneeded bits.
|
| |
|
|
|
|
|
|
|
| |
When the environment has NPY_PYTEST=1, the testing utilities will be
pytest compatible. Typical usage would be something like
$ NPY_PYTEST=1 pytest ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The aim here is to separate out the nose dependent files prior to adding
pytest support. This could be done by adding new files to the general
numpy/testing directory, but I felt that it was to have the relevant
files separated out as it makes it easier to completely remove nose
dependencies when needed.
Many places were accessing submodules in numpy/testing directly, and in
some cases incorrectly. That presented a backwards compatibility
problem. The solution adapted here is to have "dummy" files whose
contents will depend on whether of not pytest is active. That way the
module looks the same as before from the outside.
In the case of numpy itself, direct accesses have been fixed. Having
proper `__all__` lists in the submodules helped in that.
|
|
|
|
|
|
|
| |
It seems ok to let this warning show up, and it does not directly
relate to the test run itself, so moving it before setting up the
warnings for the actual tests (and printing out the system info,
so that it is not confused to originate in the actual tests).
|
|
|
|
| |
Useful because no one can remember the magic ``extra_argv`` incantation.
|
|
|
|
|
|
|
| |
Motivation is to be able to use `nose-timer` within the test() function.
Try (after installing nose-timer):
np.test(extra_argv=['--with-timer', '--timer-top-n', '20'])
|
|
|
|
| |
These now delegate to __getitem__, so subclasses no longer need to define them
|
|
|
|
|
| |
This code was only here for Python 2.5 compatibility, but numpy requires 2.7
at minimum
|
|
|
|
|
|
|
| |
In Python 3.6 a number of escape sequences that were previously accepted
-- for instance "\(" that was translated to "\\(" -- are deprecated. To
retain the previous behavior either raw strings must be used or the
backslash must be properly escaped itself.
|
|
|
|
|
| |
Python 3.6 gets more strict about escape sequences, \. is invalid.
As it could get a syntax error the version check would not work.
|
|
|
|
|
|
| |
When python is invoked with switch -3, it emits waring "classic int division"
for strict integer divisions. The same behavior is now implemented to numpy
with this fix
|
|
|
|
|
|
| |
Making the outer context manager a suppress warnings gives good
control to print warnings only once in release mode and suppress
some specific warnings which cannot be easily avoided otherwise.
|
| |
|
|
|
|
|
|
| |
This context has a couple of advantages over the typical one, and can
ensure that warnings are cleanly filtered without side effect for
later tests.
|
| |
|
| |
|
|
|
|
| |
Addresses comment in gh-4074.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our test-runner's raise_warning mode traditionally has varied depending
on whether we have a development or release version of numpy: for
development versions we raise on warnings, and for release versions we
don't. This is all very sensible... *if* you're running numpy's test
suite. But our test-runner is also used by other packages like scipy,
and it doesn't make sense for scipy's raise_warning mode to vary
depending on whether *numpy* is a development or release version. (It
should vary depending on whether the scipy-under-test is a development
or release version.) So this commit moves the numpy-version-dependent
raise_warning logic out of the generic NoseTester class and into
numpy-specific code.
(See scipy/scipy#5609 for more discussion.)
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
| |
This approach is less error prone than switching from "develop" to "release"
in maintenance branches by hand. See gh-6461 for details.
|
|
|
|
|
|
|
| |
In python3 np.test would raise an error if raise_warnings is a list
since dict.keys() now returns a dict_keys instance. Eg,
np.test('full', raise_warnings=[FutureWarning])
|
|\
| |
| | |
TST: Make default for all warnings "always"
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This should make it easier in some cases, since a warning
caught in some test (but not important/not causing failure),
will not shadow later tests.
In principle the best thing is probably to always check the number
of warnings raised, so that you notice when a new warning shows
up in a test, though there may be other corner cases here.
|
|/ |
|
|
|
|
|
|
| |
Filed upstream as:
https://github.com/nose-devs/nose/issues/929
Not our problem.
|
|
|
|
|
| |
Fixed typos in docstrings were updated for functions where the parameter
names in the docstring didn't match the function signature.
|
|
|
|
| |
the beginning of nosetests
|
|
|
|
|
| |
allows passing flags like --pdb to test files
also add call to files where its missing
|
|
|
|
|
|
|
|
| |
This allows numpy 1.9 testing to be used with current scipy
without flooding the output with deprecation warnings.
The deprecation warnings are currently issued for both the
subtract and negative operators when used with booleans.
|
|
|
|
|
|
| |
This results in errors whenever you run tests using KnownFailure
like so: ``python test_mymodule.py`` (where run_module_suite is
used in the file, like numpy and scipy do).
|
|
|
|
|
| |
Cosmetic adjustments to previous commit (893fe99) following "charris"'s
comments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding an 'argv' optional argument to the
"numpy.testing.run_module_suite" function lets the client pass arguments
to the nose testrunner.
For example, this lets the user add things like:
run_module_suite(sys.argv)
at the end of a test module, so that arguments specified on the command
line will get passed to the nose runner. The user could then run:
$ python test_module.py --nocapture
|
|
|
|
|
|
|
| |
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
|
|
|
|
| |
Now is as good a time as any with open PR's at a low.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nanmax, nanmin
--------------
Add out and keepdims keywords.
nanargmin, nanargmax
--------------------
A NanWarning is raised if an all NaN slice detected. For all such
slices np.iingo(np.intp).min is returned as the index value.
nansum
------
The keywords dtype, out, and keepdims are added.
A FutureWarning is raised, as in the future the mean of an empty
slice after NaN replacement will be 0 instead of the current NaN.
nanmean, nanvar, nanstd
-----------------------
For all, if the input array is of inexact type then the dtype and out
parameters must be of inexact type if specified. That insures that NaNs
can be returned when appropriate.
The nanmean function detects empty slices after NaN replacement and
raises a NanWarning. NaN is returned as the value for all such slices.
The nanmean and nanstd functions detect degrees of freedom <= 0 after
NaN replacement and raise a NanWarning. NaN is returned as the value for
all such slices.
|
|
|
|
| |
Deprecate np.testing.importall - it's pointless and partially broken.
|
|
|
|
|
|
|
|
|
|
|
|
| |
WarningManager was a workaround for the lack of the with statement
in Python versions < 2.6. As those versions are no longer supported
it can be removed.
Deprecation notes are added to WarningManager and WarningMessage, but
to avoid a cascade of messages in third party apps, no warnings are
raised at this time, that can be done later.
Closes #3519.
|
|
|
|
|
|
|
|
|
| |
The numarray and oldnumeric modules are deprecated. This is a bit tricky
as raising a DeprecationWarning on import causes an error when tests are
run. To deal with that, a ModuleDeprecationWarning class is added to
numpy and NoseTester is modified to ignore that warning during testing.
Closes #2905
|
|
|
|
|
|
| |
Setuptools tends to set +x to the installed test scripts, which makes
numpy.test() to not run any tests. Having --exe always enabled is not
problematic because only files matching 'test_*.py' are looked into.
|
|
|
|
|
|
|
|
|
|
|
| |
The basestring class is not defined in Python 3 and the fixer replaces
it with str. In order to have a common code base we define basestring in
numpy/compat/py3k.py to be str when the Python version is >= 3,
otherwise basestring and import it where needed. That works for most
cases, but there are a few files where the version dependent define
needs to be in the file.
Closes #3042.
|
|
|
|
|
|
|
| |
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
|