Skip to content

Commit

Permalink
pythongh-104494: Update certain Tkinter pack/place tests for Tk 8.7 e…
Browse files Browse the repository at this point in the history
…rrors (pythonGH-104495)

(cherry picked from commit 3cba61f)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
  • Loading branch information
3 people authored and miss-islington committed May 16, 2023
1 parent f748fc9 commit ba797a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Lib/tkinter/test/test_tkinter/test_geometry_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def test_pack_configure_in(self):
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')
Expand Down Expand Up @@ -292,8 +292,10 @@ def create2(self):
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'):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update ``test_pack_configure_in`` and ``test_place_configure_in``
for changes to error message formatting in Tk 8.7.

0 comments on commit ba797a6

Please sign in to comment.