Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test
  • Loading branch information
eendebakpt committed Mar 11, 2026
commit bf01d4c3cff8edb857fe2218075d1e789d9ae077
9 changes: 9 additions & 0 deletions Lib/test/test_structseq.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import gc
import os
import pickle
import re
Expand Down Expand Up @@ -355,6 +356,14 @@ def test_reference_cycle(self):
type(t).refcyle = t
"""))

def test_replace_gc_tracked(self):
# Verify that __replace__ results are properly GC-tracked
time_struct= time.gmtime(0)
lst = []
replaced_struct = time_struct.__replace__(tm_year=lst)
lst.append(replaced_struct)

self.assertTrue(gc.is_tracked(replaced_struct))

if __name__ == "__main__":
unittest.main()