@@ -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
@@ -2435,6 +2437,11 @@ def test_output(self) -> None:
24352437 assert output == expected
24362438
24372439 def test_ignore_flags (self ) -> None :
2440+ output = run_stubtest (
2441+ stub = "" , runtime = "__all__ = ['f']\n def f(): pass" , options = ["--ignore-missing-stub" ]
2442+ )
2443+ assert output == "Success: no issues found in 1 module\n "
2444+
24382445 output = run_stubtest (stub = "" , runtime = "def f(): pass" , options = ["--ignore-missing-stub" ])
24392446 assert output == "Success: no issues found in 1 module\n "
24402447
@@ -2483,18 +2490,14 @@ def test_allowlist(self) -> None:
24832490 def good() -> None: ...
24842491 def bad(number: int) -> None: ...
24852492 def also_bad(number: int) -> None: ...
2486- """ .lstrip (
2487- "\n "
2488- )
2493+ """ .lstrip ("\n " )
24892494 ),
24902495 runtime = textwrap .dedent (
24912496 """
24922497 def good(): pass
24932498 def bad(asdf): pass
24942499 def also_bad(asdf): pass
2495- """ .lstrip (
2496- "\n "
2497- )
2500+ """ .lstrip ("\n " )
24982501 ),
24992502 options = ["--allowlist" , allowlist .name , "--generate-allowlist" ],
25002503 )
0 commit comments