diff options
Diffstat (limited to 'Lib/tkinter/test')
-rw-r--r-- | Lib/tkinter/test/runtktests.py | 2 | ||||
-rw-r--r-- | Lib/tkinter/test/test_tkinter/test_misc.py | 5 | ||||
-rw-r--r-- | Lib/tkinter/test/test_tkinter/test_widgets.py | 7 |
3 files changed, 10 insertions, 4 deletions
diff --git a/Lib/tkinter/test/runtktests.py b/Lib/tkinter/test/runtktests.py index ccb3755..dbe5e88 100644 --- a/Lib/tkinter/test/runtktests.py +++ b/Lib/tkinter/test/runtktests.py @@ -16,7 +16,7 @@ this_dir_path = os.path.abspath(os.path.dirname(__file__)) def is_package(path): for name in os.listdir(path): - if name in ('__init__.py', '__init__.pyc', '__init.pyo'): + if name in ('__init__.py', '__init__.pyc'): return True return False diff --git a/Lib/tkinter/test/test_tkinter/test_misc.py b/Lib/tkinter/test/test_tkinter/test_misc.py index d8de949..85ee2c7 100644 --- a/Lib/tkinter/test/test_tkinter/test_misc.py +++ b/Lib/tkinter/test/test_tkinter/test_misc.py @@ -7,6 +7,11 @@ support.requires('gui') class MiscTest(AbstractTkTest, unittest.TestCase): + def test_repr(self): + t = tkinter.Toplevel(self.root, name='top') + f = tkinter.Frame(t, name='child') + self.assertEqual(repr(f), '<tkinter.Frame object .top.child>') + def test_tk_setPalette(self): root = self.root root.tk_setPalette('black') diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index 8be0371..7171667 100644 --- a/Lib/tkinter/test/test_tkinter/test_widgets.py +++ b/Lib/tkinter/test/test_tkinter/test_widgets.py @@ -920,8 +920,9 @@ class ScrollbarTest(AbstractWidgetTest, unittest.TestCase): sb = self.create() for e in ('arrow1', 'slider', 'arrow2'): sb.activate(e) + self.assertEqual(sb.activate(), e) sb.activate('') - self.assertRaises(TypeError, sb.activate) + self.assertIsNone(sb.activate()) self.assertRaises(TypeError, sb.activate, 'arrow1', 'arrow2') def test_set(self): @@ -931,8 +932,8 @@ class ScrollbarTest(AbstractWidgetTest, unittest.TestCase): self.assertRaises(TclError, sb.set, 'abc', 'def') self.assertRaises(TclError, sb.set, 0.6, 'def') self.assertRaises(TclError, sb.set, 0.6, None) - self.assertRaises(TclError, sb.set, 0.6) - self.assertRaises(TclError, sb.set, 0.6, 0.7, 0.8) + self.assertRaises(TypeError, sb.set, 0.6) + self.assertRaises(TypeError, sb.set, 0.6, 0.7, 0.8) @add_standard_options(StandardOptionsTests) |