Skip to content

Commit 3fe0f15

Browse files
Simplify tests
1 parent f166933 commit 3fe0f15

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

Lib/test/test_gc.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,30 +1127,23 @@ def test_something(self):
11271127

11281128
def test_do_not_cleanup_type_subclasses_before_finalization(self):
11291129
# https://github.com/python/cpython/issues/135552
1130-
code = textwrap.dedent("""
1130+
code = """
11311131
class BaseNode:
11321132
def __del__(self):
11331133
BaseNode.next = BaseNode.next.next
1134+
BaseNode.next.next
11341135
11351136
class Node(BaseNode):
11361137
pass
11371138
11381139
BaseNode.next = Node()
11391140
BaseNode.next.next = Node()
1140-
""")
1141-
assert_python_ok("-c", code)
1141+
"""
1142+
assert_python_ok("-c", textwrap.dedent(code))
11421143

1143-
code_inside_function = textwrap.dedent("""
1144+
code_inside_function = textwrap.dedent(F"""
11441145
def test():
1145-
class BaseNode:
1146-
def __del__(self):
1147-
BaseNode.next = BaseNode.next.next
1148-
1149-
class Node(BaseNode):
1150-
pass
1151-
1152-
BaseNode.next = Node()
1153-
BaseNode.next.next = Node()
1146+
{textwrap.indent(code, ' ')}
11541147
11551148
test()
11561149
""")

0 commit comments

Comments
 (0)