Skip to content

Commit fa18b82

Browse files
authored
Improve check of expected shell commands in check/format-incremental (#7196)
Set the `CI` environment variable to get the `--color` option unconditionally. Also check if `isort` is invoked. Follow-up to #7181
1 parent 0f652e1 commit fa18b82

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dev_tools/bash_scripts_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,12 @@ def test_incremental_format_branch_selection(tmpdir_factory):
573573
'git checkout -q alt\n'
574574
'echo " print(1)" > alt.py\n'
575575
'git add -A\n'
576-
'git commit -q -m test3 --no-gpg-sign\n',
576+
'git commit -q -m test3 --no-gpg-sign\n'
577+
'export CI=true\n',
578+
additional_intercepts=['isort'],
577579
)
578580
assert result.returncode == 0
581+
assert 'INTERCEPTED isort --color --check --diff alt.py' in result.stdout
579582
assert 'INTERCEPTED black --color --check --diff alt.py' in result.stdout
580583
assert result.stderr.startswith("Comparing against revision 'main' (merge base ")
581584

0 commit comments

Comments
 (0)