summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-06-14 09:11:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-06-14 09:11:21 +0000
commitcc9f06b22c7665893e6958f7518a9e8d258e7d98 (patch)
tree19c3ef54ef886a32df2f3ed7be2f694d77b50bfc /testing
parentAdding upstream version 2.3.0. (diff)
downloadpre-commit-cc9f06b22c7665893e6958f7518a9e8d258e7d98.tar.xz
pre-commit-cc9f06b22c7665893e6958f7518a9e8d258e7d98.zip
Adding upstream version 2.5.1.upstream/2.5.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing')
-rwxr-xr-xtesting/gen-languages-all3
-rw-r--r--testing/util.py20
2 files changed, 5 insertions, 18 deletions
diff --git a/testing/gen-languages-all b/testing/gen-languages-all
index 6d0b26f..2bff7be 100755
--- a/testing/gen-languages-all
+++ b/testing/gen-languages-all
@@ -3,8 +3,7 @@ import sys
LANGUAGES = [
'conda', 'docker', 'docker_image', 'fail', 'golang', 'node', 'perl',
- 'pygrep', 'python', 'python_venv', 'ruby', 'rust', 'script', 'swift',
- 'system',
+ 'pygrep', 'python', 'ruby', 'rust', 'script', 'swift', 'system',
]
FIELDS = [
'ENVIRONMENT_DIR', 'get_default_version', 'healthy', 'install_environment',
diff --git a/testing/util.py b/testing/util.py
index 439bee7..bfe1421 100644
--- a/testing/util.py
+++ b/testing/util.py
@@ -45,20 +45,6 @@ xfailif_windows_no_ruby = pytest.mark.xfail(
xfailif_windows = pytest.mark.xfail(os.name == 'nt', reason='windows')
-def supports_venv(): # pragma: no cover (platform specific)
- try:
- __import__('ensurepip')
- __import__('venv')
- return True
- except ImportError:
- return False
-
-
-xfailif_no_venv = pytest.mark.xfail(
- not supports_venv(), reason='Does not support venv module',
-)
-
-
def run_opts(
all_files=False,
files=(),
@@ -103,10 +89,12 @@ def cwd(path):
os.chdir(original_cwd)
-def git_commit(*args, fn=cmd_output, msg='commit!', **kwargs):
+def git_commit(*args, fn=cmd_output, msg='commit!', all_files=True, **kwargs):
kwargs.setdefault('stderr', subprocess.STDOUT)
- cmd = ('git', 'commit', '--allow-empty', '--no-gpg-sign', '-a') + args
+ cmd = ('git', 'commit', '--allow-empty', '--no-gpg-sign', *args)
+ if all_files: # allow skipping `-a` with `all_files=False`
+ cmd += ('-a',)
if msg is not None: # allow skipping `-m` with `msg=None`
cmd += ('-m', msg)
ret, out, _ = fn(*cmd, **kwargs)