summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-05-06 04:37:31 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-05-06 04:37:31 (GMT)
commite3dcb01bfc6bd14da865b0f28c3c9ad8181ab212 (patch)
treea86b4bafd50bc3a309efa1b01451d64ec61c1be0 /Lib/test/test_warnings.py
parent0b7f77847a878a84c2b928e72372b4d5b44b870c (diff)
downloadcpython-e3dcb01bfc6bd14da865b0f28c3c9ad8181ab212.zip
cpython-e3dcb01bfc6bd14da865b0f28c3c9ad8181ab212.tar.gz
cpython-e3dcb01bfc6bd14da865b0f28c3c9ad8181ab212.tar.bz2
Fix a bug in the handling of the stacklevel argument in warnings.warn() where
the stack was being unwound by two levels instead of one each time.
Diffstat (limited to 'Lib/test/test_warnings.py')
-rw-r--r--Lib/test/test_warnings.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index c854d7a..1b5ee32 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -225,6 +225,8 @@ class WarnTests(unittest.TestCase):
self.assertEqual(os.path.basename(w.filename), "test_warnings.py")
warning_tests.outer("spam6", stacklevel=2)
self.assertEqual(os.path.basename(w.filename), "warning_tests.py")
+ warning_tests.outer("spam6.5", stacklevel=3)
+ self.assertEqual(os.path.basename(w.filename), "test_warnings.py")
warning_tests.inner("spam7", stacklevel=9999)
self.assertEqual(os.path.basename(w.filename), "sys")