aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-05-16 17:03:51 -0700
committerGitHub <noreply@github.com>2023-05-16 20:03:51 -0400
commitdece9c06bb0aff150e018ed7975d43e4648bb72e (patch)
treea386fbc9993507ec689c0dba5ad8a331c38dab59
parent[3.11] gh-75367: Fix data descriptor detection in inspect.getattr_static (GH-... (diff)
downloadcpython-dece9c06bb0aff150e018ed7975d43e4648bb72e.tar.gz
cpython-dece9c06bb0aff150e018ed7975d43e4648bb72e.tar.bz2
cpython-dece9c06bb0aff150e018ed7975d43e4648bb72e.zip
[3.11] gh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (GH-104495) (#104569)
gh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (GH-104495) (cherry picked from commit 3cba61f111db9b5e8ef35632915309f81fff8c6c) 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>
-rw-r--r--Lib/tkinter/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/tkinter/test/test_tkinter/test_geometry_managers.py b/Lib/tkinter/test/test_tkinter/test_geometry_managers.py
index c89bc8dbf85..0c31e366126 100644
--- a/Lib/tkinter/test/test_tkinter/test_geometry_managers.py
+++ b/Lib/tkinter/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 00000000000..a320c48428b
--- /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.