Skip to content

Commit a4fe18a

Browse files
committed
Add an extra GC test for forwardrefs
1 parent dca9a5b commit a4fe18a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Lib/test/test_dataclasses/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3893,7 +3893,15 @@ def method(self) -> int:
38933893

38943894
return SlotsTest
38953895

3896-
for make in (make_simple, make_with_annotations, make_with_annotations_and_method):
3896+
def make_with_forwardref():
3897+
@dataclass(slots=True)
3898+
class SlotsTest:
3899+
x: undefined
3900+
y: list[undefined]
3901+
3902+
return SlotsTest
3903+
3904+
for make in (make_simple, make_with_annotations, make_with_annotations_and_method, make_with_forwardref):
38973905
with self.subTest(make=make):
38983906
C = make()
38993907
support.gc_collect()

0 commit comments

Comments
 (0)