From 4ec016784b02f69347c4429829b9eb8225ace5ee Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Fri, 29 Jan 2016 01:17:55 +0100 Subject: TST: Add tests for stacklevel in warnings and "ignore" filters. Enforces that stacklevel is used in warnings.warn and "ignore" is not used in filterwarnings or simplefilter for most of numpy. --- numpy/distutils/command/egg_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/distutils/command/egg_info.py') diff --git a/numpy/distutils/command/egg_info.py b/numpy/distutils/command/egg_info.py index 972a27df3..7176f9212 100644 --- a/numpy/distutils/command/egg_info.py +++ b/numpy/distutils/command/egg_info.py @@ -10,7 +10,7 @@ class egg_info(_egg_info): import warnings warnings.warn("`build_src` is being run, this may lead to missing " "files in your sdist! See numpy issue gh-7127 for " - "details", UserWarning) + "details", UserWarning, stacklevel=2) # We need to ensure that build_src has been executed in order to give # setuptools' egg_info command real filenames instead of functions which -- cgit v1.2.1