mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
* Update Lib/warnings to CPython 3.14 * Add context_aware_warnings setting XXX- The default setting of this and thread_inherit_context should be true. * Unmark passing test * Mark failing tests * Skip failing test in test_sys for now Updating test_sys to CPython 3.14 is beyond the scope of this PR. * test_improper_option is fixed --------- Co-authored-by: Jeong, YunWon <jeong@youknowone.org>
18 lines
590 B
Python
Vendored
18 lines
590 B
Python
Vendored
# Helper module for testing stacklevel and skip_file_prefixes arguments
|
|
# of warnings.warn()
|
|
|
|
import warnings
|
|
from test.test_warnings.data import package_helper
|
|
|
|
|
|
def outer(message, stacklevel=1, skip_file_prefixes=()):
|
|
inner(message, stacklevel, skip_file_prefixes)
|
|
|
|
def inner(message, stacklevel=1, skip_file_prefixes=()):
|
|
warnings.warn(message, stacklevel=stacklevel,
|
|
skip_file_prefixes=skip_file_prefixes)
|
|
|
|
def package(message, *, stacklevel):
|
|
package_helper.inner_api(message, stacklevel=stacklevel,
|
|
warnings_module=warnings)
|