mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Add tests for the filename.
Test that the stacklevel is handled correctly.
This commit is contained in:
parent
8bd65000d7
commit
e1a9b42c38
2 changed files with 33 additions and 0 deletions
9
Lib/test/warning_tests.py
Normal file
9
Lib/test/warning_tests.py
Normal file
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue