@@ -70,7 +70,7 @@ def test_end_to_end_stdin(input_file: str, expected_file: str, args: List[str],
70
70
71
71
if verify :
72
72
# When using stin, the dry run flag is disregarded.
73
- assert pc .returncode == 1 if input_ != expected else 0
73
+ assert pc .returncode == ( 1 if input_ != expected else 0 )
74
74
else :
75
75
assert output == expected
76
76
assert pc .returncode == 0
@@ -97,11 +97,14 @@ def test_end_to_end_file(input_file: str, expected_file: str, args: List[str], t
97
97
output = pc .stdout .strip ()
98
98
if verify :
99
99
if expected != input_ :
100
+ assert "Dry run: would have stripped" in output
100
101
assert pc .returncode == 1
101
102
102
103
# Since verify implies --dry-run, we make sure the file is not modified
103
- # In other words, that the output == input, INSTEAD of output == expected
104
- assert output == input_
104
+ with open (NOTEBOOKS_FOLDER / input_file , mode = "r" ) as f :
105
+ output_ = f .read ()
106
+
107
+ assert output_ == input_
105
108
else :
106
109
assert pc .returncode == 0
107
110
assert not pc .stdout and p .read_text () == expected
@@ -120,7 +123,7 @@ def test_dry_run_stdin(input_file: str, extra_args: List[str], verify: bool):
120
123
output = pc .stdout
121
124
122
125
assert output == expected
123
- assert pc .returncode == 1 if verify else 0
126
+ assert pc .returncode == ( 1 if verify else 0 )
124
127
125
128
126
129
@pytest .mark .parametrize ("input_file, extra_args" , DRY_RUN_CASES )
0 commit comments