screen, gui tests must be 'guarded' by "requires('gui')" in a setUp
function or method. This will typically be setUpClass.
-All gui objects must be destroyed by the end of the test, perhaps in a tearDown
-function. Creating the Tk root directly in a setUp allows a reference to be saved
-so it can be properly destroyed in the corresponding tearDown.
+To avoid interfering with other gui tests, all gui objects must be destroyed
+and deleted by the end of the test. If a widget, such as a Tk root, is created
+in a setUpX function, destroy it in the corresponding tearDownX. For module
+and class attributes, also delete the widget.
---
@classmethod
def setUpClass(cls):
@classmethod
def tearDownClass(cls):
cls.root.destroy()
+ del cls.root
---
Support.requires('gui') returns true if it is either called in a main module
@classmethod
def tearDownClass(cls):
cls.root.destroy()
+ del cls.root
def fetch_test(self, reverse, line, prefix, index, *, bell=False):
# Perform one fetch as invoked by Alt-N or Alt-P
## @classmethod
## def tearDownClass(cls):
## cls.root.destroy()
+## del cls.root
def test_get_selection(self):
# text = Text(master=self.root)
## @classmethod
## def tearDownClass(cls):
## cls.root.destroy()
+## del cls.root
def test_search(self):
Equal = self.assertEqual
## @classmethod
## def tearDownClass(cls):
## cls.root.destroy()
+## del cls.root
@classmethod
def setUpClass(cls):