@@ -169,12 +169,14 @@ def run_stubtest_with_stderr(
169169 filtered_output = remove_color_code (
170170 output .getvalue ()
171171 # remove cwd as it's not available from outside
172- .replace (os .path .realpath (tmp_dir ) + os .sep , "" ).replace (tmp_dir + os .sep , "" )
172+ .replace (os .path .realpath (tmp_dir ) + os .sep , "" )
173+ .replace (tmp_dir + os .sep , "" )
173174 )
174175 filtered_outerr = remove_color_code (
175176 outerr .getvalue ()
176177 # remove cwd as it's not available from outside
177- .replace (os .path .realpath (tmp_dir ) + os .sep , "" ).replace (tmp_dir + os .sep , "" )
178+ .replace (os .path .realpath (tmp_dir ) + os .sep , "" )
179+ .replace (tmp_dir + os .sep , "" )
178180 )
179181 return filtered_output , filtered_outerr
180182
@@ -1403,7 +1405,7 @@ def test_all_at_runtime_not_stub(self) -> Iterator[Case]:
14031405 runtime = """
14041406 __all__ = []
14051407 Z = 5""" ,
1406- error = None ,
1408+ error = "__all__" ,
14071409 )
14081410
14091411 @collect_cases
@@ -1443,7 +1445,7 @@ def h(x: str): ...
14431445 runtime = "" ,
14441446 error = "h" ,
14451447 )
1446- yield Case (stub = "" , runtime = "__all__ = []" , error = None ) # dummy case
1448+ yield Case (stub = "" , runtime = "__all__ = []" , error = "__all__" ) # dummy case
14471449 yield Case (stub = "" , runtime = "__all__ += ['y']\n y = 5" , error = "y" )
14481450 yield Case (stub = "" , runtime = "__all__ += ['g']\n def g(): pass" , error = "g" )
14491451 # Here we should only check that runtime has B, since the stub explicitly re-exports it
@@ -2435,11 +2437,6 @@ def test_output(self) -> None:
24352437 assert output == expected
24362438
24372439 def test_ignore_flags (self ) -> None :
2438- output = run_stubtest (
2439- stub = "" , runtime = "__all__ = ['f']\n def f(): pass" , options = ["--ignore-missing-stub" ]
2440- )
2441- assert output == "Success: no issues found in 1 module\n "
2442-
24432440 output = run_stubtest (stub = "" , runtime = "def f(): pass" , options = ["--ignore-missing-stub" ])
24442441 assert output == "Success: no issues found in 1 module\n "
24452442
@@ -2488,18 +2485,14 @@ def test_allowlist(self) -> None:
24882485 def good() -> None: ...
24892486 def bad(number: int) -> None: ...
24902487 def also_bad(number: int) -> None: ...
2491- """ .lstrip (
2492- "\n "
2493- )
2488+ """ .lstrip ("\n " )
24942489 ),
24952490 runtime = textwrap .dedent (
24962491 """
24972492 def good(): pass
24982493 def bad(asdf): pass
24992494 def also_bad(asdf): pass
2500- """ .lstrip (
2501- "\n "
2502- )
2495+ """ .lstrip ("\n " )
25032496 ),
25042497 options = ["--allowlist" , allowlist .name , "--generate-allowlist" ],
25052498 )
0 commit comments