Skip to content

Commit 15868c3

Browse files
committed
test: style: fix black ignoring integration_test/build directory
When `black` is passed multiple directories, it will try to look for `pyproject.toml` in the common ancestor of those paths. In our cases, since we pass it `tests`, `.buildkite` and `tools`, that would be the repository root. However, our pyproject.toml sits in `tests`, and thus the `exclude` rule it defines is ignored (and it is this `exclude` rules that overwrites the default behavior of excluding directories called `build`). Fix this by explicitly passing in a `--config` argument. Since `isort` does not support this argument, pass it in a quite ugly via by adding it to the pytest parameters. Fixes: 4f55e49 Signed-off-by: Patrick Roy <[email protected]>
1 parent eb26211 commit 15868c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/integration_tests/style/test_python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pytest
99

1010

11-
@pytest.mark.parametrize("formatter", ["black", "isort"])
11+
@pytest.mark.parametrize("formatter", ["black --config tests/pyproject.toml", "isort"])
1212
def test_python_style(formatter):
1313
"""
1414
Test that python code passes `formatter`

0 commit comments

Comments
 (0)