https://github.com/python/cpython/commit/bf150f61ad85dd609f412f1c87dec6245f484f0d
commit: bf150f61ad85dd609f412f1c87dec6245f484f0d
branch: main
author: Petr Viktorin <[email protected]>
committer: encukou <[email protected]>
date: 2025-01-21T11:28:34+01:00
summary:
gh-126349: test_turtle: Add cleanup to avoid reference leaks (GH-129079)
files:
M Lib/test/test_turtle.py
diff --git a/Lib/test/test_turtle.py b/Lib/test/test_turtle.py
index de6508ff8c791d..d02cac284a909a 100644
--- a/Lib/test/test_turtle.py
+++ b/Lib/test/test_turtle.py
@@ -570,6 +570,9 @@ def setUp(self):
with patch_screen():
self.turtle = turtle.Turtle()
+ # Reset the Screen singleton to avoid reference leaks
+ self.addCleanup(setattr, turtle.Turtle, '_screen', None)
+
def test_begin_end_fill(self):
self.assertFalse(self.turtle.filling())
self.turtle.begin_fill()
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]