Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf150f6

Browse files
authored
gh-126349: test_turtle: Add cleanup to avoid reference leaks (GH-129079)
1 parent f5b6356 commit bf150f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_turtle.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,9 @@ def setUp(self):
570570
with patch_screen():
571571
self.turtle = turtle.Turtle()
572572

573+
# Reset the Screen singleton to avoid reference leaks
574+
self.addCleanup(setattr, turtle.Turtle, '_screen', None)
575+
573576
def test_begin_end_fill(self):
574577
self.assertFalse(self.turtle.filling())
575578
self.turtle.begin_fill()

0 commit comments

Comments
 (0)