From c1580be7d396e9b8b5f4d662f5c5b2f842239dc3 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 27 Aug 2019 21:28:06 -0700 Subject: [PATCH 1/2] Remove redundant flake8 dependency Committed via https://github.com/asottile/all-repos --- requirements-dev.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 157f287d..ba80df7f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,6 @@ -e . coverage -flake8 mock pytest pytest-env From d3474dfff339acb056c93f396bc889abcafac069 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 28 Aug 2019 11:41:03 -0700 Subject: [PATCH 2/2] make the tests not depend on flake8 being installed --- tests/commands/run_test.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py index 94d44e15..49ce008c 100644 --- a/tests/commands/run_test.py +++ b/tests/commands/run_test.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals import io import os.path +import pipes import subprocess import sys @@ -642,9 +643,11 @@ def test_local_hook_passes(cap_out, store, repo_with_passing_hook): 'repo': 'local', 'hooks': [ { - 'id': 'flake8', - 'name': 'flake8', - 'entry': "'{}' -m flake8".format(sys.executable), + 'id': 'identity-copy', + 'name': 'identity-copy', + 'entry': '{} -m pre_commit.meta_hooks.identity'.format( + pipes.quote(sys.executable), + ), 'language': 'system', 'files': r'\.py$', }, @@ -869,10 +872,13 @@ def test_args_hook_only(cap_out, store, repo_with_passing_hook): 'repo': 'local', 'hooks': [ { - 'id': 'flake8', - 'name': 'flake8', - 'entry': "'{}' -m flake8".format(sys.executable), + 'id': 'identity-copy', + 'name': 'identity-copy', + 'entry': '{} -m pre_commit.meta_hooks.identity'.format( + pipes.quote(sys.executable), + ), 'language': 'system', + 'files': r'\.py$', 'stages': ['commit'], }, { @@ -891,4 +897,4 @@ def test_args_hook_only(cap_out, store, repo_with_passing_hook): repo_with_passing_hook, run_opts(hook='do_not_commit'), ) - assert b'flake8' not in printed + assert b'identity-copy' not in printed