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