diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-05-06 11:00:04 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-05-06 11:00:04 (GMT) |
commit | 645058d11a0ce6616d93cce692bb1378e61efb80 (patch) | |
tree | 16ce60bf4c02ce722c8873bcf8975d0aea1e2030 /Lib/tkinter/test | |
parent | 008d88b46218ea618455c89cba74132be223c1a4 (diff) | |
download | cpython-645058d11a0ce6616d93cce692bb1378e61efb80.zip cpython-645058d11a0ce6616d93cce692bb1378e61efb80.tar.gz cpython-645058d11a0ce6616d93cce692bb1378e61efb80.tar.bz2 |
Issue #23880: Tkinter's getint() and getdouble() now support Tcl_Obj.
Tkinter's getdouble() now supports any numbers (in particular int).
Diffstat (limited to 'Lib/tkinter/test')
-rw-r--r-- | Lib/tkinter/test/test_tkinter/test_variables.py | 6 | ||||
-rw-r--r-- | Lib/tkinter/test/test_ttk/test_extensions.py | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_variables.py b/Lib/tkinter/test/test_tkinter/test_variables.py index 4b72943..abdce96 100644 --- a/Lib/tkinter/test/test_tkinter/test_variables.py +++ b/Lib/tkinter/test/test_tkinter/test_variables.py @@ -122,10 +122,10 @@ class TestIntVar(TestBase): def test_invalid_value(self): v = IntVar(self.root, name="name") self.root.globalsetvar("name", "value") - with self.assertRaises(ValueError): + with self.assertRaises((ValueError, TclError)): v.get() self.root.globalsetvar("name", "345.0") - with self.assertRaises(ValueError): + with self.assertRaises((ValueError, TclError)): v.get() @@ -152,7 +152,7 @@ class TestDoubleVar(TestBase): def test_invalid_value(self): v = DoubleVar(self.root, name="name") self.root.globalsetvar("name", "value") - with self.assertRaises(ValueError): + with self.assertRaises((ValueError, TclError)): v.get() diff --git a/Lib/tkinter/test/test_ttk/test_extensions.py b/Lib/tkinter/test/test_ttk/test_extensions.py index c3af06c..f33945c 100644 --- a/Lib/tkinter/test/test_ttk/test_extensions.py +++ b/Lib/tkinter/test/test_ttk/test_extensions.py @@ -70,17 +70,15 @@ class LabeledScaleTest(AbstractTkTest, unittest.TestCase): # variable initialization/passing passed_expected = (('0', 0), (0, 0), (10, 10), (-1, -1), (sys.maxsize + 1, sys.maxsize + 1)) - if self.wantobjects: - passed_expected += ((2.5, 2),) for pair in passed_expected: x = ttk.LabeledScale(self.root, from_=pair[0]) self.assertEqual(x.value, pair[1]) x.destroy() x = ttk.LabeledScale(self.root, from_='2.5') - self.assertRaises(ValueError, x._variable.get) + self.assertRaises((ValueError, tkinter.TclError), x._variable.get) x.destroy() x = ttk.LabeledScale(self.root, from_=None) - self.assertRaises(ValueError, x._variable.get) + self.assertRaises((ValueError, tkinter.TclError), x._variable.get) x.destroy() # variable should have its default value set to the from_ value myvar = tkinter.DoubleVar(self.root, value=20) |