@@ -40,7 +40,10 @@ def run_fill(
40
40
"""Create a function to run the fill command with various output directory scenarios."""
41
41
42
42
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 ,
44
47
) -> pytest .RunResult :
45
48
"""Run the fill command with the specified output directory and clean flag."""
46
49
pytester .copy_example (name = str (test_path ))
@@ -58,6 +61,9 @@ def _run_fill(
58
61
]
59
62
if clean :
60
63
args .append ("--clean" )
64
+ if disable_capture_output :
65
+ # Required for tests on stdout
66
+ args .append ("-s" )
61
67
62
68
result = pytester .runpytest (* args )
63
69
@@ -157,12 +163,13 @@ def test_fill_stdout_always_works(tmp_path_factory: TempPathFactory, run_fill):
157
163
"""Test filling to stdout always works regardless of output state."""
158
164
stdout_path = Path ("stdout" )
159
165
# 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"
161
168
meta_dir = output_dir / ".meta"
162
169
meta_dir .mkdir ()
163
170
(meta_dir / "existing_meta_file.txt" ).write_text ("This is metadata" )
164
171
165
- result : pytest .RunResult = run_fill (stdout_path )
172
+ result : pytest .RunResult = run_fill (stdout_path , disable_capture_output = True )
166
173
167
174
assert any (
168
175
"test_chainid.py::test_chainid[fork_Cancun-state_test]" in line for line in result .outlines
0 commit comments