diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-02-27 23:48:13 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-02-27 23:48:13 (GMT) |
commit | 78c330d714a76439e5c17d0a156d25d53d4c5a68 (patch) | |
tree | f462aea04c80754a20601f6a51bd51a4de3649a0 /Lib/idlelib | |
parent | b5782de4631a5e598c017b0f8f563fac2c9a895a (diff) | |
parent | 9db1ab82508cd4be4195e520da8cb8d86cd1f7e4 (diff) | |
download | cpython-78c330d714a76439e5c17d0a156d25d53d4c5a68.zip cpython-78c330d714a76439e5c17d0a156d25d53d4c5a68.tar.gz cpython-78c330d714a76439e5c17d0a156d25d53d4c5a68.tar.bz2 |
Merge with 3.3
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/idle_test/README.txt | 8 | ||||
-rw-r--r-- | Lib/idlelib/idle_test/test_formatparagraph.py | 3 | ||||
-rw-r--r-- | Lib/idlelib/idle_test/test_idlehistory.py | 1 | ||||
-rw-r--r-- | Lib/idlelib/idle_test/test_searchengine.py | 3 | ||||
-rw-r--r-- | Lib/idlelib/idle_test/test_text.py | 1 |
5 files changed, 13 insertions, 3 deletions
diff --git a/Lib/idlelib/idle_test/README.txt b/Lib/idlelib/idle_test/README.txt index d0dde25..6b92483 100644 --- a/Lib/idlelib/idle_test/README.txt +++ b/Lib/idlelib/idle_test/README.txt @@ -41,9 +41,10 @@ idle class. For the benefit of buildbot machines that do not have a graphics 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): @@ -53,6 +54,7 @@ so it can be properly destroyed in the corresponding tearDown. @classmethod def tearDownClass(cls): cls.root.destroy() + del cls.root --- Support.requires('gui') returns true if it is either called in a main module diff --git a/Lib/idlelib/idle_test/test_formatparagraph.py b/Lib/idlelib/idle_test/test_formatparagraph.py index 818c9d4..f4a7c2d 100644 --- a/Lib/idlelib/idle_test/test_formatparagraph.py +++ b/Lib/idlelib/idle_test/test_formatparagraph.py @@ -277,6 +277,9 @@ class FormatEventTest(unittest.TestCase): @classmethod def tearDownClass(cls): cls.root.destroy() + del cls.root + del cls.text + del cls.formatter def test_short_line(self): self.text.insert('1.0', "Short line\n") diff --git a/Lib/idlelib/idle_test/test_idlehistory.py b/Lib/idlelib/idle_test/test_idlehistory.py index b27db91..d7c3d70 100644 --- a/Lib/idlelib/idle_test/test_idlehistory.py +++ b/Lib/idlelib/idle_test/test_idlehistory.py @@ -80,6 +80,7 @@ class FetchTest(unittest.TestCase): @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 diff --git a/Lib/idlelib/idle_test/test_searchengine.py b/Lib/idlelib/idle_test/test_searchengine.py index fdf38bd..129a5a3 100644 --- a/Lib/idlelib/idle_test/test_searchengine.py +++ b/Lib/idlelib/idle_test/test_searchengine.py @@ -64,6 +64,7 @@ class GetSelectionTest(unittest.TestCase): ## @classmethod ## def tearDownClass(cls): ## cls.root.destroy() +## del cls.root def test_get_selection(self): # text = Text(master=self.root) @@ -219,6 +220,7 @@ class SearchTest(unittest.TestCase): ## @classmethod ## def tearDownClass(cls): ## cls.root.destroy() +## del cls.root def test_search(self): Equal = self.assertEqual @@ -261,6 +263,7 @@ class ForwardBackwardTest(unittest.TestCase): ## @classmethod ## def tearDownClass(cls): ## cls.root.destroy() +## del cls.root @classmethod def setUpClass(cls): diff --git a/Lib/idlelib/idle_test/test_text.py b/Lib/idlelib/idle_test/test_text.py index 367bf38..5ac2fd7 100644 --- a/Lib/idlelib/idle_test/test_text.py +++ b/Lib/idlelib/idle_test/test_text.py @@ -221,6 +221,7 @@ class TkTextTest(TextTest, unittest.TestCase): @classmethod def tearDownClass(cls): cls.root.destroy() + del cls.root if __name__ == '__main__': |