From 81642420c4da18fabd6cc8e9c5e3365a57e6afba Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 12 May 2020 10:14:34 +0100 Subject: [PATCH] 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 --- tests/test_cookiecutter_generation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 51500705..664158b5 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -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())