]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_ttk_guionly.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / test / test_ttk_guionly.py
CommitLineData
4710c53d 1import os\r
2import unittest\r
3from test import test_support\r
4\r
5# Skip this test if _tkinter wasn't built.\r
6test_support.import_module('_tkinter')\r
7\r
8import ttk\r
9from _tkinter import TclError\r
10\r
11try:\r
12 ttk.Button()\r
13except TclError, msg:\r
14 # assuming ttk is not available\r
15 raise unittest.SkipTest("ttk not available: %s" % msg)\r
16\r
17this_dir = os.path.dirname(os.path.abspath(__file__))\r
18lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir,\r
19 'lib-tk', 'test'))\r
20\r
21with test_support.DirsOnSysPath(lib_tk_test):\r
22 import runtktests\r
23\r
24def test_main(enable_gui=False):\r
25 if enable_gui:\r
26 if test_support.use_resources is None:\r
27 test_support.use_resources = ['gui']\r
28 elif 'gui' not in test_support.use_resources:\r
29 test_support.use_resources.append('gui')\r
30\r
31 with test_support.DirsOnSysPath(lib_tk_test):\r
32 from test_ttk.support import get_tk_root\r
33 try:\r
34 test_support.run_unittest(\r
35 *runtktests.get_tests(text=False, packages=['test_ttk']))\r
36 finally:\r
37 get_tk_root().destroy()\r
38\r
39if __name__ == '__main__':\r
40 test_main(enable_gui=True)\r