@@ -1018,7 +1018,9 @@ def visit_BoolOp(self, boolop: ast.BoolOp) -> tuple[ast.Name, str]:
10181018 ]
10191019 ):
10201020 pytest_temp = self .variable ()
1021- self .variables_overwrite [self .scope ][v .left .target .id ] = v .left # type:ignore[assignment]
1021+ self .variables_overwrite [self .scope ][
1022+ v .left .target .id
1023+ ] = v .left # type:ignore[assignment]
10221024 v .left .target .id = pytest_temp
10231025 self .push_format_context ()
10241026 res , expl = self .visit (v )
@@ -1062,15 +1064,19 @@ def visit_Call(self, call: ast.Call) -> tuple[ast.Name, str]:
10621064 if isinstance (arg , ast .Name ) and arg .id in self .variables_overwrite .get (
10631065 self .scope , {}
10641066 ):
1065- arg = self .variables_overwrite [self .scope ][arg .id ] # type:ignore[assignment]
1067+ arg = self .variables_overwrite [self .scope ][
1068+ arg .id
1069+ ] # type:ignore[assignment]
10661070 res , expl = self .visit (arg )
10671071 arg_expls .append (expl )
10681072 new_args .append (res )
10691073 for keyword in call .keywords :
10701074 if isinstance (
10711075 keyword .value , ast .Name
10721076 ) and keyword .value .id in self .variables_overwrite .get (self .scope , {}):
1073- keyword .value = self .variables_overwrite [self .scope ][keyword .value .id ] # type:ignore[assignment]
1077+ keyword .value = self .variables_overwrite [self .scope ][
1078+ keyword .value .id
1079+ ] # type:ignore[assignment]
10741080 res , expl = self .visit (keyword .value )
10751081 new_kwargs .append (ast .keyword (keyword .arg , res ))
10761082 if keyword .arg :
@@ -1107,9 +1113,13 @@ def visit_Compare(self, comp: ast.Compare) -> tuple[ast.expr, str]:
11071113 if isinstance (
11081114 comp .left , ast .Name
11091115 ) and comp .left .id in self .variables_overwrite .get (self .scope , {}):
1110- comp .left = self .variables_overwrite [self .scope ][comp .left .id ] # type:ignore[assignment]
1116+ comp .left = self .variables_overwrite [self .scope ][
1117+ comp .left .id
1118+ ] # type:ignore[assignment]
11111119 if isinstance (comp .left , ast .NamedExpr ):
1112- self .variables_overwrite [self .scope ][comp .left .target .id ] = comp .left # type:ignore[assignment]
1120+ self .variables_overwrite [self .scope ][
1121+ comp .left .target .id
1122+ ] = comp .left # type:ignore[assignment]
11131123 left_res , left_expl = self .visit (comp .left )
11141124 if isinstance (comp .left , (ast .Compare , ast .BoolOp )):
11151125 left_expl = f"({ left_expl } )"
@@ -1127,7 +1137,9 @@ def visit_Compare(self, comp: ast.Compare) -> tuple[ast.expr, str]:
11271137 and next_operand .target .id == left_res .id
11281138 ):
11291139 next_operand .target .id = self .variable ()
1130- self .variables_overwrite [self .scope ][left_res .id ] = next_operand # type:ignore[assignment]
1140+ self .variables_overwrite [self .scope ][
1141+ left_res .id
1142+ ] = next_operand # type:ignore[assignment]
11311143 next_res , next_expl = self .visit (next_operand )
11321144 if isinstance (next_operand , (ast .Compare , ast .BoolOp )):
11331145 next_expl = f"({ next_expl } )"
0 commit comments