File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -1483,6 +1483,18 @@ def test_parameters_required_after_star(self):
1483
1483
with self .subTest (block = block ):
1484
1484
self .expect_failure (block , err )
1485
1485
1486
+ def test_parameters_required_after_depr_star (self ):
1487
+ dataset = (
1488
+ "module foo\n foo.bar\n * [from 3.14]" ,
1489
+ "module foo\n foo.bar\n * [from 3.14]\n Docstring here." ,
1490
+ "module foo\n foo.bar\n this: int\n * [from 3.14]" ,
1491
+ "module foo\n foo.bar\n this: int\n * [from 3.14]\n Docstring." ,
1492
+ )
1493
+ err = "Function 'foo.bar' specifies '* [from 3.14]' without any parameters afterwards."
1494
+ for block in dataset :
1495
+ with self .subTest (block = block ):
1496
+ self .expect_failure (block , err )
1497
+
1486
1498
def test_depr_star_invalid_format_1 (self ):
1487
1499
block = """
1488
1500
module foo
Original file line number Diff line number Diff line change @@ -5729,12 +5729,10 @@ def check_remaining(
5729
5729
) -> None :
5730
5730
assert isinstance (self .function , Function )
5731
5731
5732
- if values := self .function .parameters .values ():
5733
- last_param = next (reversed (values ))
5734
- no_param_after_symbol = condition (last_param )
5735
- else :
5736
- no_param_after_symbol = True
5737
- if no_param_after_symbol :
5732
+ values = self .function .parameters .values ()
5733
+ assert values
5734
+ last_param = next (reversed (values ))
5735
+ if condition (last_param ):
5738
5736
fname = self .function .full_name
5739
5737
fail (f"Function { fname !r} specifies { symbol !r} "
5740
5738
"without any parameters afterwards." , line_number = lineno )
You can’t perform that action at this time.
0 commit comments