summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Chavez <chrischavez@gmx.us>2023-05-15 03:54:41 -0500
committerGitHub <noreply@github.com>2023-05-15 04:54:41 -0400
commit3cba61f111db9b5e8ef35632915309f81fff8c6c (patch)
tree7529f703f4d1767416e3d15007d3a4940c2a9056
parent9d41f83c58e6dc2fc6eb4b91f803551850b0adeb (diff)
downloadcpython-git-3cba61f111db9b5e8ef35632915309f81fff8c6c.tar.gz
gh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (#104495)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
-rw-r--r--Lib/test/test_tkinter/test_geometry_managers.py10
-rw-r--r--Misc/NEWS.d/next/Tests/2023-05-15-02-22-44.gh-issue-104494.Bkrbfn.rst2
2 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_tkinter/test_geometry_managers.py b/Lib/test/test_tkinter/test_geometry_managers.py
index 3663048a14..59fe592b49 100644
--- a/Lib/test/test_tkinter/test_geometry_managers.py
+++ b/Lib/test/test_tkinter/test_geometry_managers.py
@@ -108,8 +108,8 @@ class PackTest(AbstractWidgetTest, unittest.TestCase):
a.pack_configure(in_=c)
self.assertEqual(pack.pack_slaves(), [b, c, d])
self.assertEqual(c.pack_slaves(), [a])
- with self.assertRaisesRegex(TclError,
- 'can\'t pack %s inside itself' % (a,)):
+ with self.assertRaisesRegex(
+ TclError, """can't pack "?%s"? inside itself""" % (a,)):
a.pack_configure(in_=a)
with self.assertRaisesRegex(TclError, 'bad window path name ".foo"'):
a.pack_configure(in_='.foo')
@@ -292,8 +292,10 @@ class PlaceTest(AbstractWidgetTest, unittest.TestCase):
def test_place_configure_in(self):
t, f, f2 = self.create2()
self.assertEqual(f2.winfo_manager(), '')
- with self.assertRaisesRegex(TclError, "can't place %s relative to "
- "itself" % re.escape(str(f2))):
+ with self.assertRaisesRegex(
+ TclError,
+ """can't place "?%s"? relative to itself"""
+ % re.escape(str(f2))):
f2.place_configure(in_=f2)
self.assertEqual(f2.winfo_manager(), '')
with self.assertRaisesRegex(TclError, 'bad window path name'):
diff --git a/Misc/NEWS.d/next/Tests/2023-05-15-02-22-44.gh-issue-104494.Bkrbfn.rst b/Misc/NEWS.d/next/Tests/2023-05-15-02-22-44.gh-issue-104494.Bkrbfn.rst
new file mode 100644
index 0000000000..a320c48428
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2023-05-15-02-22-44.gh-issue-104494.Bkrbfn.rst
@@ -0,0 +1,2 @@
+Update ``test_pack_configure_in`` and ``test_place_configure_in``
+for changes to error message formatting in Tk 8.7.