-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
test_track_literals depends on a garbage collection #155728
Copy link
Copy link
Open
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
_not_tracked_instantly()requires the tuple to be untracked without a collection. This holds for tuples created at run time, but tuple constants are created tracked and are only untracked by_PyTuple_MaybeUntrack(), which is called only from the collector.So
test_track_literalspasses only if a collection happens between importing the module and running the test. Under regrtest it does not:while
./python -m unittest test.test_tuple.TupleTest.test_track_literalspasses.Untracking tuple constants when the code object is created would let the test keep the stronger check.
Linked PRs