diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-04-03 16:53:43 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-04-03 16:53:43 (GMT) |
commit | e1a9b42c38c8466775f02a2659cda8e6aa6ca9e5 (patch) | |
tree | 7bc6bbb046b234a1f376cb0a7463eba7846ea9ac /Lib/test/warning_tests.py | |
parent | 8bd65000d78cd75a00c073ab9147e3d53ba02a2d (diff) | |
download | cpython-e1a9b42c38c8466775f02a2659cda8e6aa6ca9e5.zip cpython-e1a9b42c38c8466775f02a2659cda8e6aa6ca9e5.tar.gz cpython-e1a9b42c38c8466775f02a2659cda8e6aa6ca9e5.tar.bz2 |
Add tests for the filename.
Test that the stacklevel is handled correctly.
Diffstat (limited to 'Lib/test/warning_tests.py')
-rw-r--r-- | Lib/test/warning_tests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/warning_tests.py b/Lib/test/warning_tests.py new file mode 100644 index 0000000..d0519ef --- /dev/null +++ b/Lib/test/warning_tests.py @@ -0,0 +1,9 @@ +# Helper module for testing the skipmodules argument of warnings.warn() + +import warnings + +def outer(message, stacklevel=1): + inner(message, stacklevel) + +def inner(message, stacklevel=1): + warnings.warn(message, stacklevel=stacklevel) |