Todo: 集成多平台 解决因SaiNiu线程抢占资源问题 本地提交测试环境打包 和 正式打包脚本与正式环境打包bat 提交Python32环境包 改进多日志文件生成情况修改打包日志细节
This commit is contained in:
1896
Utils/PythonNew32/Lib/test/test_warnings/__init__.py
Normal file
1896
Utils/PythonNew32/Lib/test/test_warnings/__init__.py
Normal file
File diff suppressed because it is too large
Load Diff
3
Utils/PythonNew32/Lib/test/test_warnings/__main__.py
Normal file
3
Utils/PythonNew32/Lib/test/test_warnings/__main__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import unittest
|
||||
|
||||
unittest.main('test.test_warnings')
|
||||
@@ -0,0 +1,3 @@
|
||||
import warnings
|
||||
|
||||
warnings.warn('module-level warning', DeprecationWarning, stacklevel=2)
|
||||
@@ -0,0 +1,10 @@
|
||||
# helper to the helper for testing skip_file_prefixes.
|
||||
|
||||
import os
|
||||
|
||||
package_path = os.path.dirname(__file__)
|
||||
|
||||
def inner_api(message, *, stacklevel, warnings_module):
|
||||
warnings_module.warn(
|
||||
message, stacklevel=stacklevel,
|
||||
skip_file_prefixes=(package_path,))
|
||||
15
Utils/PythonNew32/Lib/test/test_warnings/data/stacklevel.py
Normal file
15
Utils/PythonNew32/Lib/test/test_warnings/data/stacklevel.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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):
|
||||
inner(message, stacklevel)
|
||||
|
||||
def inner(message, stacklevel=1):
|
||||
warnings.warn(message, stacklevel=stacklevel)
|
||||
|
||||
def package(message, *, stacklevel):
|
||||
package_helper.inner_api(message, stacklevel=stacklevel,
|
||||
warnings_module=warnings)
|
||||
Reference in New Issue
Block a user