本文整理汇总了Python中test.test_support.DirsOnSysPath方法的典型用法代码示例。如果您正苦于以下问题:Python test_support.DirsOnSysPath方法的具体用法?Python test_support.DirsOnSysPath怎么用?Python test_support.DirsOnSysPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.test_support
的用法示例。
在下文中一共展示了test_support.DirsOnSysPath方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import DirsOnSysPath [as 别名]
def test_main():
with test_support.DirsOnSysPath(lib_tk_test):
test_support.run_unittest(
*runtktests.get_tests(text=False, packages=['test_ttk']))
示例2: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import DirsOnSysPath [as 别名]
def test_main():
with test_support.DirsOnSysPath(lib_tk_test):
test_support.run_unittest(
*runtktests.get_tests(gui=False, packages=['test_ttk']))
示例3: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import DirsOnSysPath [as 别名]
def test_main():
with test_support.DirsOnSysPath(lib_tk_test):
test_support.run_unittest(
*runtktests.get_tests(text=False, packages=['test_tkinter']))
示例4: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import DirsOnSysPath [as 别名]
def test_main(enable_gui=False):
if enable_gui:
if test_support.use_resources is None:
test_support.use_resources = ['gui']
elif 'gui' not in test_support.use_resources:
test_support.use_resources.append('gui')
with test_support.DirsOnSysPath(lib_tk_test):
from test_ttk.support import get_tk_root
try:
test_support.run_unittest(
*runtktests.get_tests(text=False, packages=['test_ttk']))
finally:
get_tk_root().destroy()
示例5: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import DirsOnSysPath [as 别名]
def test_main(enable_gui=False):
if enable_gui:
if test_support.use_resources is None:
test_support.use_resources = ['gui']
elif 'gui' not in test_support.use_resources:
test_support.use_resources.append('gui')
with test_support.DirsOnSysPath(lib_tk_test):
test_support.run_unittest(
*runtktests.get_tests(text=False, packages=['test_tkinter']))
示例6: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import DirsOnSysPath [as 别名]
def test_main():
with test_support.DirsOnSysPath(lib_tk_test):
from test_ttk.support import get_tk_root
try:
test_support.run_unittest(
*runtktests.get_tests(text=False, packages=['test_ttk']))
finally:
get_tk_root().destroy()
示例7: test_bug1239
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import DirsOnSysPath [as 别名]
def test_bug1239(self):
jar = test_support.findfile("bug1239.jar")
with test_support.DirsOnSysPath(jar):
import org.test403javapackage.test403
# different from test_bug1239 in that only a Java package is imported, not
# a Java class. I'd also like to get rid of this checked in test jar.
示例8: test_bug1126
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import DirsOnSysPath [as 别名]
def test_bug1126(self):
jar = test_support.findfile("bug1126.jar", subdir="bug1126")
with test_support.DirsOnSysPath(jar):
import org.subpackage
示例9: test_path_in_pyclasspath
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import DirsOnSysPath [as 别名]
def test_path_in_pyclasspath(self):
jar = self.prepareJar('classimport_Lib.jar')
compiled = self.compileToJar(jar, 'Lib')
Thread.currentThread().contextClassLoader = test_support.make_jar_classloader(jar)
with test_support.DirsOnSysPath():
sys.path = ['__pyclasspath__/Lib']
self.checkImports('__pyclasspath__/Lib', compiled)