blob: e6d759e7bd3b615040fbee1f6b826117aebf7e7d [file] [log] [blame]
Zachary Ware4baebfe2015-05-17 20:55:42 -05001import unittest
2from test import support
Hai Shif7ba40b2020-06-25 18:38:51 +08003from test.support import import_helper
Zachary Ware4baebfe2015-05-17 20:55:42 -05004import sys
5
6# Skip this test if the _tkinter module wasn't built.
Hai Shif7ba40b2020-06-25 18:38:51 +08007_tkinter = import_helper.import_module('_tkinter')
Zachary Ware4baebfe2015-05-17 20:55:42 -05008
9# Skip test if tk cannot be initialized.
10support.requires('gui')
11
12from tkinter import tix, TclError
13
14
15class TestTix(unittest.TestCase):
16
17 def setUp(self):
18 try:
19 self.root = tix.Tk()
20 except TclError:
21 if sys.platform.startswith('win'):
22 self.fail('Tix should always be available on Windows')
23 self.skipTest('Tix not available')
24 else:
25 self.addCleanup(self.root.destroy)
26
27 def test_tix_available(self):
28 # this test is just here to make setUp run
29 pass
30
31
32if __name__ == '__main__':
33 unittest.main()