(root)/
Python-3.11.7/
Lib/
test/
test_tix.py
       1  import sys
       2  import unittest
       3  from test import support
       4  from test.support import import_helper
       5  from test.support import check_sanitizer
       6  
       7  if check_sanitizer(address=True, memory=True):
       8      raise unittest.SkipTest("Tests involvin libX11 can SEGFAULT on ASAN/MSAN builds")
       9  
      10  
      11  # Skip this test if the _tkinter module wasn't built.
      12  _tkinter = import_helper.import_module('_tkinter')
      13  
      14  # Skip test if tk cannot be initialized.
      15  support.requires('gui')
      16  
      17  # Suppress the deprecation warning
      18  tix = import_helper.import_module('tkinter.tix', deprecated=True)
      19  from tkinter import TclError
      20  
      21  
      22  class ESC[4;38;5;81mTestTix(ESC[4;38;5;149munittestESC[4;38;5;149m.ESC[4;38;5;149mTestCase):
      23  
      24      def setUp(self):
      25          try:
      26              self.root = tix.Tk()
      27          except TclError:
      28              if sys.platform.startswith('win'):
      29                  self.fail('Tix should always be available on Windows')
      30              self.skipTest('Tix not available')
      31          else:
      32              self.addCleanup(self.root.destroy)
      33  
      34      def test_tix_available(self):
      35          # this test is just here to make setUp run
      36          pass
      37  
      38  
      39  if __name__ == '__main__':
      40      unittest.main()