本文整理匯總了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)