blob: 8a60c7c8e1fbd57fcafce8e474bf901325ea31bf [file] [log] [blame]
Miss Islington (bot)ec6a1ea2021-05-07 09:14:48 -07001import sys
Zachary Ware4baebfe2015-05-17 20:55:42 -05002import unittest
3from test import support
Hai Shif7ba40b2020-06-25 18:38:51 +08004from test.support import import_helper
Zachary Ware4baebfe2015-05-17 20:55:42 -05005
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
Miss Islington (bot)ec6a1ea2021-05-07 09:14:48 -070012# Suppress the deprecation warning
13tix = import_helper.import_module('tkinter.tix', deprecated=True)
14from tkinter import TclError
Zachary Ware4baebfe2015-05-17 20:55:42 -050015
16
17class TestTix(unittest.TestCase):
18
19 def setUp(self):
20 try:
21 self.root = tix.Tk()
22 except TclError:
23 if sys.platform.startswith('win'):
24 self.fail('Tix should always be available on Windows')
25 self.skipTest('Tix not available')
26 else:
27 self.addCleanup(self.root.destroy)
28
Miss Islington (bot)c3eb3c12021-05-09 00:19:43 -070029 def test_tix_available(self):
30 # this test is just here to make setUp run
31 pass
Zachary Ware4baebfe2015-05-17 20:55:42 -050032
33
34if __name__ == '__main__':
35 unittest.main()