@@ -40,7 +40,10 @@ def run_fill(
4040 """Create a function to run the fill command with various output directory scenarios."""
4141
4242 def _run_fill (
43- output_dir : Path , clean : bool = False , expect_failure : bool = False
43+ output_dir : Path ,
44+ clean : bool = False ,
45+ expect_failure : bool = False ,
46+ disable_capture_output : bool = False ,
4447 ) -> pytest .RunResult :
4548 """Run the fill command with the specified output directory and clean flag."""
4649 pytester .copy_example (name = str (test_path ))
@@ -58,6 +61,9 @@ def _run_fill(
5861 ]
5962 if clean :
6063 args .append ("--clean" )
64+ if disable_capture_output :
65+ # Required for tests on stdout
66+ args .append ("-s" )
6167
6268 result = pytester .runpytest (* args )
6369
@@ -157,12 +163,13 @@ def test_fill_stdout_always_works(tmp_path_factory: TempPathFactory, run_fill):
157163 """Test filling to stdout always works regardless of output state."""
158164 stdout_path = Path ("stdout" )
159165 # create a directory called "stdout" - it should not have any effect
160- output_dir = tmp_path_factory .mktemp (stdout_path .name )
166+ output_dir = tmp_path_factory .mktemp (stdout_path .name , numbered = False )
167+ assert str (output_dir .stem ) == "stdout"
161168 meta_dir = output_dir / ".meta"
162169 meta_dir .mkdir ()
163170 (meta_dir / "existing_meta_file.txt" ).write_text ("This is metadata" )
164171
165- result : pytest .RunResult = run_fill (stdout_path )
172+ result : pytest .RunResult = run_fill (stdout_path , disable_capture_output = True )
166173
167174 assert any (
168175 "test_chainid.py::test_chainid[fork_Cancun-state_test]" in line for line in result .outlines
0 commit comments