ยปCore Development>Code coverage>Lib/test/test_tix.py

Python code coverage for Lib/test/test_tix.py

#countcontent
1n/aimport unittest
2n/afrom test import support
3n/aimport sys
4n/a
5n/a# Skip this test if the _tkinter module wasn't built.
6n/a_tkinter = support.import_module('_tkinter')
7n/a
8n/a# Skip test if tk cannot be initialized.
9n/asupport.requires('gui')
10n/a
11n/afrom tkinter import tix, TclError
12n/a
13n/a
14n/aclass TestTix(unittest.TestCase):
15n/a
16n/a def setUp(self):
17n/a try:
18n/a self.root = tix.Tk()
19n/a except TclError:
20n/a if sys.platform.startswith('win'):
21n/a self.fail('Tix should always be available on Windows')
22n/a self.skipTest('Tix not available')
23n/a else:
24n/a self.addCleanup(self.root.destroy)
25n/a
26n/a def test_tix_available(self):
27n/a # this test is just here to make setUp run
28n/a pass
29n/a
30n/a
31n/aif __name__ == '__main__':
32n/a unittest.main()