diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2024-06-22 06:53:24 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-22 06:53:24 (GMT) |
| commit | 6ad26de6e8ab61b035e7ecfff9791c2b349c3ad0 (patch) | |
| tree | f4259444ec145581e9834a6acacdf8027fb5ba6f /Lib/test/test_tcl.py | |
| parent | 8f17d69b7bc906e8407095317842cc0fd52cd84a (diff) | |
| download | cpython-6ad26de6e8ab61b035e7ecfff9791c2b349c3ad0.zip cpython-6ad26de6e8ab61b035e7ecfff9791c2b349c3ad0.tar.gz cpython-6ad26de6e8ab61b035e7ecfff9791c2b349c3ad0.tar.bz2 | |
gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824)
The tests are now passed with the current version of Tcl/Tk under
development (8.7b1+ and 9.0b3+).
The following changes were also made to make the tests more flexible:
* Helper methods like checkParam() now interpret the expected error message
as a regular expression instead of a literal.
* Add support of new arguments in checkEnumParam():
- allow_empty=True skips testing with empty string;
- fullname= specifies the name for error message if it differs from the
option name;
- sort=True sorts values for error message.
* Add support of the allow_empty argument in checkReliefParam():
allow_empty=True adds an empty string to the list of accepted values.
* Attributes _clip_highlightthickness, _clip_pad and _clip_borderwidth
specify how negative values of options -highlightthickness, -padx, -pady
and -borderwidth are handled.
* Use global variables for some common error messages.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/test/test_tcl.py')
| -rw-r--r-- | Lib/test/test_tcl.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py index 553d543..e6cf2c7 100644 --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -219,10 +219,18 @@ class TclTest(unittest.TestCase): with open(filename, 'wb') as f: f.write(b""" set a "<\xed\xa0\xbd\xed\xb2\xbb>" + """) + if tcl_version >= (9, 0): + self.assertRaises(TclError, tcl.evalfile, filename) + else: + tcl.evalfile(filename) + self.assertEqual(tcl.eval('set a'), '<\U0001f4bb>') + + with open(filename, 'wb') as f: + f.write(b""" set b "<\\ud83d\\udcbb>" """) tcl.evalfile(filename) - self.assertEqual(tcl.eval('set a'), '<\U0001f4bb>') self.assertEqual(tcl.eval('set b'), '<\U0001f4bb>') def testEvalFileException(self): |
