diff options
author | Stephan Hoyer <shoyer@gmail.com> | 2016-01-16 16:35:28 -0800 |
---|---|---|
committer | Stephan Hoyer <shoyer@gmail.com> | 2016-01-16 16:35:28 -0800 |
commit | da98bbc030c272edb1a8548a458b3957e29ce346 (patch) | |
tree | 0836fad6fe78c0e5416ac4bb028503c847f99d95 | |
parent | 426114879da49bf9a586b1991dcaf38ce594c4b6 (diff) | |
download | numpy-da98bbc030c272edb1a8548a458b3957e29ce346.tar.gz |
DOC: document changes to assert_warns
-rw-r--r-- | doc/release/1.11.0-notes.rst | 4 | ||||
-rw-r--r-- | numpy/testing/utils.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/release/1.11.0-notes.rst b/doc/release/1.11.0-notes.rst index ac3c1578c..8ac8e963f 100644 --- a/doc/release/1.11.0-notes.rst +++ b/doc/release/1.11.0-notes.rst @@ -186,6 +186,10 @@ if the matrix product is between a matrix and its transpose, it will use **Note:** Requires the transposed and non-transposed matrices to share data. +*np.testing.assert_warns* can now be used as a context manager +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This matches the behavior of ``assert_raises``. + Changes ======= Pyrex support was removed from ``numpy.distutils``. The method diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 72105ca31..10a48ad79 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -1736,6 +1736,8 @@ def assert_warns(warning_class, *args, **kwargs): with assert_warns(SomeWarning): do_something() + The ability to be used as a context manager is new in NumPy v1.11.0. + .. versionadded:: 1.4.0 Parameters @@ -1783,6 +1785,8 @@ def assert_no_warnings(*args, **kwargs): with assert_no_warnings(): do_something() + The ability to be used as a context manager is new in NumPy v1.11.0. + .. versionadded:: 1.7.0 Parameters |