summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorRyan Polley <rypolley@gmail.com>2020-12-22 10:15:20 -0600
committerRyan Polley <rypolley@gmail.com>2020-12-22 10:19:00 -0600
commitdd25816ccb9701af74895c95d3f0f2d31abbdf01 (patch)
tree519f34eaad688873d9a0de979efcf64b6cc063f2 /numpy
parentb05294c169438d4e230374f0e9677682d84c0094 (diff)
downloadnumpy-dd25816ccb9701af74895c95d3f0f2d31abbdf01.tar.gz
TST: add stacklevel parameter to test calls to warnings.warn
For whatever reason the build system doesn't like the test calls to warnings.warn with no stacklevel parameter inside the tests that I moved.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_deprecations.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/tests/test_deprecations.py b/numpy/core/tests/test_deprecations.py
index f6f3a3d42..25cd3d229 100644
--- a/numpy/core/tests/test_deprecations.py
+++ b/numpy/core/tests/test_deprecations.py
@@ -954,18 +954,18 @@ class TestNoseDecoratorsDeprecated(_DeprecationTestCase):
@np.testing.dec.deprecated()
def deprecated_func():
import warnings
- warnings.warn("TEST: deprecated func", DeprecationWarning)
+ warnings.warn("TEST: deprecated func", DeprecationWarning, stacklevel=1)
@np.testing.dec.deprecated()
def deprecated_func2():
import warnings
- warnings.warn("AHHHH")
+ warnings.warn("AHHHH", stacklevel=1)
raise ValueError
@np.testing.dec.deprecated()
def deprecated_func3():
import warnings
- warnings.warn("AHHHH")
+ warnings.warn("AHHHH", stacklevel=1)
# marked as deprecated, but does not raise DeprecationWarning
assert_raises(AssertionError, non_deprecated_func)