Run flake8 from the generated project root

3.8.1 can't find the config if running from elsewhere:
https://gitlab.com/pycqa/flake8/-/issues/639
This commit is contained in:
Bruno Alla 2020-05-12 10:14:34 +01:00
parent cd740c2619
commit 81642420c4

View File

@ -156,7 +156,7 @@ def test_flake8_passes(cookies, context_override):
result = cookies.bake(extra_context=context_override)
try:
sh.flake8(str(result.project))
sh.flake8(_cwd=str(result.project))
except sh.ErrorReturnCode as e:
pytest.fail(e.stdout.decode())
@ -167,7 +167,7 @@ def test_black_passes(cookies, context_override):
result = cookies.bake(extra_context=context_override)
try:
sh.black("--check", "--diff", "--exclude", "migrations", f"{result.project}/")
sh.black("--check", "--diff", "--exclude", "migrations", _cwd=str(result.project))
except sh.ErrorReturnCode as e:
pytest.fail(e.stdout.decode())