Skip to content

Commit d484ad8

Browse files
committed
text fix
1 parent d7fcbfc commit d484ad8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_end_to_end.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_end_to_end_stdin(input_file: str, expected_file: str, args: List[str],
7070

7171
if verify:
7272
# 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)
7474
else:
7575
assert output == expected
7676
assert pc.returncode == 0
@@ -97,11 +97,14 @@ def test_end_to_end_file(input_file: str, expected_file: str, args: List[str], t
9797
output = pc.stdout.strip()
9898
if verify:
9999
if expected != input_:
100+
assert "Dry run: would have stripped" in output
100101
assert pc.returncode == 1
101102

102103
# 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_
105108
else:
106109
assert pc.returncode == 0
107110
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):
120123
output = pc.stdout
121124

122125
assert output == expected
123-
assert pc.returncode == 1 if verify else 0
126+
assert pc.returncode == (1 if verify else 0)
124127

125128

126129
@pytest.mark.parametrize("input_file, extra_args", DRY_RUN_CASES)

0 commit comments

Comments
 (0)