diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2015-10-14 23:33:03 +0200 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@gmail.com> | 2015-10-15 00:16:56 +0200 |
commit | 7b438fa90e53abe8b2f0356ec50daed6ab299794 (patch) | |
tree | 82111508209b8dc7b8a2c0c5bb884883aef737a3 | |
parent | 9a62a26ab9689bbcf8a4eeb0076848ca9c44d4ae (diff) | |
download | numpy-7b438fa90e53abe8b2f0356ec50daed6ab299794.tar.gz |
TST: raise errors for dev versions and warnings for releases on test runs.
This approach is less error prone than switching from "develop" to "release"
in maintenance branches by hand. See gh-6461 for details.
-rw-r--r-- | doc/HOWTO_RELEASE.rst.txt | 16 | ||||
-rw-r--r-- | numpy/testing/nosetester.py | 22 |
2 files changed, 13 insertions, 25 deletions
diff --git a/doc/HOWTO_RELEASE.rst.txt b/doc/HOWTO_RELEASE.rst.txt index a88e4db47..5fed523c1 100644 --- a/doc/HOWTO_RELEASE.rst.txt +++ b/doc/HOWTO_RELEASE.rst.txt @@ -196,16 +196,6 @@ After a date is set, create a new maintenance/x.y.z branch, add new empty release notes for the next version in the master branch and update the Trac Milestones. -Handle test warnings --------------------- -The default behavior of the test suite in the master branch is to report errors -for DeprecationWarnings and RuntimeWarnings that are issued. For a released -version this is not desired. Therefore any known warnings should be solved or -explicitly silenced before making the release branch, then when the branch is -made, the default behavior should be switched to not raise errors. This is -done in the constructor of the NoseTester class in numpy/testing/nosetester.py, -by replacing ``raise_warnings="develop"`` with ``raise_warnings="release"``. - Make sure current trunk builds a package correctly -------------------------------------------------- :: @@ -220,12 +210,6 @@ best to read the pavement.py script. .. note:: The following steps are repeated for the beta(s), release candidates(s) and the final release. -Merge doc wiki edits --------------------- -The edits in the documentation wiki suitable for merging should be merged, -ideally just before making the release branch. How to do this is described in -detail in doc/HOWTO_MERGE_WIKI_DOCS.txt. - Check that docs can be built ---------------------------- Do:: diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py index faed0e651..95ded8d93 100644 --- a/numpy/testing/nosetester.py +++ b/numpy/testing/nosetester.py @@ -10,7 +10,7 @@ import os import sys import warnings from numpy.compat import basestring -from numpy import ModuleDeprecationWarning +import numpy as np def get_package_name(filepath): @@ -151,7 +151,7 @@ class NoseTester(object): The package to test. If a string, this should be the full path to the package. If None (default), `package` is set to the module from which `NoseTester` is initialized. - raise_warnings : str or sequence of warnings, optional + raise_warnings : None, str or sequence of warnings, optional This specifies which warnings to configure as 'raise' instead of 'warn' during the test execution. Valid strings are: @@ -163,11 +163,10 @@ class NoseTester(object): Notes ----- The default for `raise_warnings` is - ``(DeprecationWarning, RuntimeWarning)`` for the master branch of NumPy, - and ``()`` for maintenance branches and released versions. The purpose - of this switching behavior is to catch as many warnings as possible - during development, but not give problems for packaging of released - versions. + ``(DeprecationWarning, RuntimeWarning)`` for development versions of NumPy, + and ``()`` for released versions. The purpose of this switching behavior + is to catch as many warnings as possible during development, but not give + problems for packaging of released versions. """ # Stuff to exclude from tests. These are from numpy.distutils @@ -177,7 +176,12 @@ class NoseTester(object): 'pyrex_ext', 'swig_ext'] - def __init__(self, package=None, raise_warnings="develop"): + def __init__(self, package=None, raise_warnings=None): + if raise_warnings is None and '.dev0' in np.__version__: + raise_warnings = "develop" + elif raise_warnings is None: + raise_warnings = "release" + package_name = None if package is None: f = sys._getframe(1) @@ -418,7 +422,7 @@ class NoseTester(object): warnings.filterwarnings('ignore', message='Not importing directory') warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwarnings("ignore", message="numpy.ufunc size changed") - warnings.filterwarnings("ignore", category=ModuleDeprecationWarning) + warnings.filterwarnings("ignore", category=np.ModuleDeprecationWarning) warnings.filterwarnings("ignore", category=FutureWarning) # Filter out boolean '-' deprecation messages. This allows # older versions of scipy to test without a flood of messages. |