mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Merge pull request #1349 from pre-commit/covdefaults
Use covdefaults to handle coveragerc
This commit is contained in:
commit
0a8ba31b9b
19 changed files with 42 additions and 81 deletions
37
.coveragerc
37
.coveragerc
|
|
@ -1,37 +0,0 @@
|
||||||
[run]
|
|
||||||
branch = True
|
|
||||||
source = .
|
|
||||||
omit =
|
|
||||||
.tox/*
|
|
||||||
/usr/*
|
|
||||||
setup.py
|
|
||||||
# Don't complain if non-runnable code isn't run
|
|
||||||
*/__main__.py
|
|
||||||
pre_commit/resources/*
|
|
||||||
|
|
||||||
[report]
|
|
||||||
show_missing = True
|
|
||||||
skip_covered = True
|
|
||||||
exclude_lines =
|
|
||||||
# Have to re-enable the standard pragma
|
|
||||||
\#\s*pragma: no cover
|
|
||||||
# We optionally substitute this
|
|
||||||
${COVERAGE_IGNORE_WINDOWS}
|
|
||||||
|
|
||||||
# Don't complain if tests don't hit defensive assertion code:
|
|
||||||
^\s*raise AssertionError\b
|
|
||||||
^\s*raise NotImplementedError\b
|
|
||||||
^\s*return NotImplemented\b
|
|
||||||
^\s*raise$
|
|
||||||
|
|
||||||
# Ignore typing-related things
|
|
||||||
^if (False|TYPE_CHECKING):
|
|
||||||
: \.\.\.$
|
|
||||||
|
|
||||||
# Don't complain if non-runnable code isn't run:
|
|
||||||
^if __name__ == ['"]__main__['"]:$
|
|
||||||
|
|
||||||
[html]
|
|
||||||
directory = coverage-html
|
|
||||||
|
|
||||||
# vim:ft=dosini
|
|
||||||
|
|
@ -18,9 +18,6 @@ jobs:
|
||||||
parameters:
|
parameters:
|
||||||
toxenvs: [py37]
|
toxenvs: [py37]
|
||||||
os: windows
|
os: windows
|
||||||
additional_variables:
|
|
||||||
COVERAGE_IGNORE_WINDOWS: '# pragma: windows no cover'
|
|
||||||
TOX_TESTENV_PASSENV: COVERAGE_IGNORE_WINDOWS
|
|
||||||
pre_test:
|
pre_test:
|
||||||
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
|
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
|
||||||
displayName: Add conda to PATH
|
displayName: Add conda to PATH
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ if sys.platform == 'win32': # pragma: no cover (windows)
|
||||||
terminal_supports_color = False
|
terminal_supports_color = False
|
||||||
else:
|
else:
|
||||||
terminal_supports_color = True
|
terminal_supports_color = True
|
||||||
else: # pragma: windows no cover
|
else: # pragma: win32 no cover
|
||||||
terminal_supports_color = True
|
terminal_supports_color = True
|
||||||
|
|
||||||
RED = '\033[41m'
|
RED = '\033[41m'
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ def _hook_paths(
|
||||||
|
|
||||||
|
|
||||||
def is_our_script(filename: str) -> bool:
|
def is_our_script(filename: str) -> bool:
|
||||||
if not os.path.exists(filename): # pragma: windows no cover (symlink)
|
if not os.path.exists(filename): # pragma: win32 no cover (symlink)
|
||||||
return False
|
return False
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
contents = f.read()
|
contents = f.read()
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ if os.name == 'nt': # pragma: no cover (windows)
|
||||||
# before closing a file or exiting the program."
|
# before closing a file or exiting the program."
|
||||||
# TODO: https://github.com/python/typeshed/pull/3607
|
# TODO: https://github.com/python/typeshed/pull/3607
|
||||||
msvcrt.locking(fileno, msvcrt.LK_UNLCK, _region) # type: ignore
|
msvcrt.locking(fileno, msvcrt.LK_UNLCK, _region) # type: ignore
|
||||||
else: # pragma: windows no cover
|
else: # pragma: win32 no cover
|
||||||
import fcntl
|
import fcntl
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
|
|
|
||||||
|
|
@ -17,16 +17,16 @@ get_default_version = helpers.basic_get_default_version
|
||||||
healthy = helpers.basic_healthy
|
healthy = helpers.basic_healthy
|
||||||
|
|
||||||
|
|
||||||
def md5(s: str) -> str: # pragma: windows no cover
|
def md5(s: str) -> str: # pragma: win32 no cover
|
||||||
return hashlib.md5(s.encode()).hexdigest()
|
return hashlib.md5(s.encode()).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
def docker_tag(prefix: Prefix) -> str: # pragma: windows no cover
|
def docker_tag(prefix: Prefix) -> str: # pragma: win32 no cover
|
||||||
md5sum = md5(os.path.basename(prefix.prefix_dir)).lower()
|
md5sum = md5(os.path.basename(prefix.prefix_dir)).lower()
|
||||||
return f'pre-commit-{md5sum}'
|
return f'pre-commit-{md5sum}'
|
||||||
|
|
||||||
|
|
||||||
def docker_is_running() -> bool: # pragma: windows no cover
|
def docker_is_running() -> bool: # pragma: win32 no cover
|
||||||
try:
|
try:
|
||||||
cmd_output_b('docker', 'ps')
|
cmd_output_b('docker', 'ps')
|
||||||
except CalledProcessError:
|
except CalledProcessError:
|
||||||
|
|
@ -35,7 +35,7 @@ def docker_is_running() -> bool: # pragma: windows no cover
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def assert_docker_available() -> None: # pragma: windows no cover
|
def assert_docker_available() -> None: # pragma: win32 no cover
|
||||||
assert docker_is_running(), (
|
assert docker_is_running(), (
|
||||||
'Docker is either not running or not configured in this environment'
|
'Docker is either not running or not configured in this environment'
|
||||||
)
|
)
|
||||||
|
|
@ -45,7 +45,7 @@ def build_docker_image(
|
||||||
prefix: Prefix,
|
prefix: Prefix,
|
||||||
*,
|
*,
|
||||||
pull: bool,
|
pull: bool,
|
||||||
) -> None: # pragma: windows no cover
|
) -> None: # pragma: win32 no cover
|
||||||
cmd: Tuple[str, ...] = (
|
cmd: Tuple[str, ...] = (
|
||||||
'docker', 'build',
|
'docker', 'build',
|
||||||
'--tag', docker_tag(prefix),
|
'--tag', docker_tag(prefix),
|
||||||
|
|
@ -60,7 +60,7 @@ def build_docker_image(
|
||||||
|
|
||||||
def install_environment(
|
def install_environment(
|
||||||
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
|
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
|
||||||
) -> None: # pragma: windows no cover
|
) -> None: # pragma: win32 no cover
|
||||||
helpers.assert_version_default('docker', version)
|
helpers.assert_version_default('docker', version)
|
||||||
helpers.assert_no_additional_deps('docker', additional_dependencies)
|
helpers.assert_no_additional_deps('docker', additional_dependencies)
|
||||||
assert_docker_available()
|
assert_docker_available()
|
||||||
|
|
@ -76,14 +76,14 @@ def install_environment(
|
||||||
os.mkdir(directory)
|
os.mkdir(directory)
|
||||||
|
|
||||||
|
|
||||||
def get_docker_user() -> str: # pragma: windows no cover
|
def get_docker_user() -> str: # pragma: win32 no cover
|
||||||
try:
|
try:
|
||||||
return f'{os.getuid()}:{os.getgid()}'
|
return f'{os.getuid()}:{os.getgid()}'
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return '1000:1000'
|
return '1000:1000'
|
||||||
|
|
||||||
|
|
||||||
def docker_cmd() -> Tuple[str, ...]: # pragma: windows no cover
|
def docker_cmd() -> Tuple[str, ...]: # pragma: win32 no cover
|
||||||
return (
|
return (
|
||||||
'docker', 'run',
|
'docker', 'run',
|
||||||
'--rm',
|
'--rm',
|
||||||
|
|
@ -100,7 +100,7 @@ def run_hook(
|
||||||
hook: Hook,
|
hook: Hook,
|
||||||
file_args: Sequence[str],
|
file_args: Sequence[str],
|
||||||
color: bool,
|
color: bool,
|
||||||
) -> Tuple[int, bytes]: # pragma: windows no cover
|
) -> Tuple[int, bytes]: # pragma: win32 no cover
|
||||||
assert_docker_available()
|
assert_docker_available()
|
||||||
# Rebuild the docker image in case it has gone missing, as many people do
|
# Rebuild the docker image in case it has gone missing, as many people do
|
||||||
# automated cleanup of docker images.
|
# automated cleanup of docker images.
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ def run_hook(
|
||||||
hook: Hook,
|
hook: Hook,
|
||||||
file_args: Sequence[str],
|
file_args: Sequence[str],
|
||||||
color: bool,
|
color: bool,
|
||||||
) -> Tuple[int, bytes]: # pragma: windows no cover
|
) -> Tuple[int, bytes]: # pragma: win32 no cover
|
||||||
assert_docker_available()
|
assert_docker_available()
|
||||||
cmd = docker_cmd() + hook.cmd
|
cmd = docker_cmd() + hook.cmd
|
||||||
return helpers.run_xargs(hook, cmd, file_args, color=color)
|
return helpers.run_xargs(hook, cmd, file_args, color=color)
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ def get_env_patch(venv: str) -> PatchesT:
|
||||||
elif sys.platform == 'win32': # pragma: no cover
|
elif sys.platform == 'win32': # pragma: no cover
|
||||||
install_prefix = bin_dir(venv)
|
install_prefix = bin_dir(venv)
|
||||||
lib_dir = 'Scripts'
|
lib_dir = 'Scripts'
|
||||||
else: # pragma: windows no cover
|
else: # pragma: win32 no cover
|
||||||
install_prefix = venv
|
install_prefix = venv
|
||||||
lib_dir = 'lib'
|
lib_dir = 'lib'
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ healthy = helpers.basic_healthy
|
||||||
def get_env_patch(
|
def get_env_patch(
|
||||||
venv: str,
|
venv: str,
|
||||||
language_version: str,
|
language_version: str,
|
||||||
) -> PatchesT: # pragma: windows no cover
|
) -> PatchesT: # pragma: win32 no cover
|
||||||
patches: PatchesT = (
|
patches: PatchesT = (
|
||||||
('GEM_HOME', os.path.join(venv, 'gems')),
|
('GEM_HOME', os.path.join(venv, 'gems')),
|
||||||
('RBENV_ROOT', venv),
|
('RBENV_ROOT', venv),
|
||||||
|
|
@ -43,7 +43,7 @@ def get_env_patch(
|
||||||
return patches
|
return patches
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager # pragma: windows no cover
|
@contextlib.contextmanager # pragma: win32 no cover
|
||||||
def in_env(
|
def in_env(
|
||||||
prefix: Prefix,
|
prefix: Prefix,
|
||||||
language_version: str,
|
language_version: str,
|
||||||
|
|
@ -64,7 +64,7 @@ def _extract_resource(filename: str, dest: str) -> None:
|
||||||
def _install_rbenv(
|
def _install_rbenv(
|
||||||
prefix: Prefix,
|
prefix: Prefix,
|
||||||
version: str = C.DEFAULT,
|
version: str = C.DEFAULT,
|
||||||
) -> None: # pragma: windows no cover
|
) -> None: # pragma: win32 no cover
|
||||||
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
||||||
|
|
||||||
_extract_resource('rbenv.tar.gz', prefix.path('.'))
|
_extract_resource('rbenv.tar.gz', prefix.path('.'))
|
||||||
|
|
@ -80,7 +80,7 @@ def _install_rbenv(
|
||||||
def _install_ruby(
|
def _install_ruby(
|
||||||
prefix: Prefix,
|
prefix: Prefix,
|
||||||
version: str,
|
version: str,
|
||||||
) -> None: # pragma: windows no cover
|
) -> None: # pragma: win32 no cover
|
||||||
try:
|
try:
|
||||||
helpers.run_setup_cmd(prefix, ('rbenv', 'download', version))
|
helpers.run_setup_cmd(prefix, ('rbenv', 'download', version))
|
||||||
except CalledProcessError: # pragma: no cover (usually find with download)
|
except CalledProcessError: # pragma: no cover (usually find with download)
|
||||||
|
|
@ -90,7 +90,7 @@ def _install_ruby(
|
||||||
|
|
||||||
def install_environment(
|
def install_environment(
|
||||||
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
|
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
|
||||||
) -> None: # pragma: windows no cover
|
) -> None: # pragma: win32 no cover
|
||||||
additional_dependencies = tuple(additional_dependencies)
|
additional_dependencies = tuple(additional_dependencies)
|
||||||
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
directory = helpers.environment_dir(ENVIRONMENT_DIR, version)
|
||||||
with clean_path_on_failure(prefix.path(directory)):
|
with clean_path_on_failure(prefix.path(directory)):
|
||||||
|
|
@ -121,6 +121,6 @@ def run_hook(
|
||||||
hook: Hook,
|
hook: Hook,
|
||||||
file_args: Sequence[str],
|
file_args: Sequence[str],
|
||||||
color: bool,
|
color: bool,
|
||||||
) -> Tuple[int, bytes]: # pragma: windows no cover
|
) -> Tuple[int, bytes]: # pragma: win32 no cover
|
||||||
with in_env(hook.prefix, hook.language_version):
|
with in_env(hook.prefix, hook.language_version):
|
||||||
return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
|
return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,12 @@ BUILD_DIR = '.build'
|
||||||
BUILD_CONFIG = 'release'
|
BUILD_CONFIG = 'release'
|
||||||
|
|
||||||
|
|
||||||
def get_env_patch(venv: str) -> PatchesT: # pragma: windows no cover
|
def get_env_patch(venv: str) -> PatchesT: # pragma: win32 no cover
|
||||||
bin_path = os.path.join(venv, BUILD_DIR, BUILD_CONFIG)
|
bin_path = os.path.join(venv, BUILD_DIR, BUILD_CONFIG)
|
||||||
return (('PATH', (bin_path, os.pathsep, Var('PATH'))),)
|
return (('PATH', (bin_path, os.pathsep, Var('PATH'))),)
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager # pragma: windows no cover
|
@contextlib.contextmanager # pragma: win32 no cover
|
||||||
def in_env(prefix: Prefix) -> Generator[None, None, None]:
|
def in_env(prefix: Prefix) -> Generator[None, None, None]:
|
||||||
envdir = prefix.path(
|
envdir = prefix.path(
|
||||||
helpers.environment_dir(ENVIRONMENT_DIR, C.DEFAULT),
|
helpers.environment_dir(ENVIRONMENT_DIR, C.DEFAULT),
|
||||||
|
|
@ -37,7 +37,7 @@ def in_env(prefix: Prefix) -> Generator[None, None, None]:
|
||||||
|
|
||||||
def install_environment(
|
def install_environment(
|
||||||
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
|
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
|
||||||
) -> None: # pragma: windows no cover
|
) -> None: # pragma: win32 no cover
|
||||||
helpers.assert_version_default('swift', version)
|
helpers.assert_version_default('swift', version)
|
||||||
helpers.assert_no_additional_deps('swift', additional_dependencies)
|
helpers.assert_no_additional_deps('swift', additional_dependencies)
|
||||||
directory = prefix.path(
|
directory = prefix.path(
|
||||||
|
|
@ -59,6 +59,6 @@ def run_hook(
|
||||||
hook: Hook,
|
hook: Hook,
|
||||||
file_args: Sequence[str],
|
file_args: Sequence[str],
|
||||||
color: bool,
|
color: bool,
|
||||||
) -> Tuple[int, bytes]: # pragma: windows no cover
|
) -> Tuple[int, bytes]: # pragma: win32 no cover
|
||||||
with in_env(hook.prefix):
|
with in_env(hook.prefix):
|
||||||
return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
|
return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ def normexe(orig: str) -> str:
|
||||||
_error('is a directory')
|
_error('is a directory')
|
||||||
elif not os.path.isfile(orig):
|
elif not os.path.isfile(orig):
|
||||||
_error('not found')
|
_error('not found')
|
||||||
elif not os.access(orig, os.X_OK): # pragma: windows no cover
|
elif not os.access(orig, os.X_OK): # pragma: win32 no cover
|
||||||
_error('is not executable')
|
_error('is not executable')
|
||||||
else:
|
else:
|
||||||
return orig
|
return orig
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ def cmd_output(*cmd: str, **kwargs: Any) -> Tuple[int, str, Optional[str]]:
|
||||||
return returncode, stdout, stderr
|
return returncode, stdout, stderr
|
||||||
|
|
||||||
|
|
||||||
if os.name != 'nt': # pragma: windows no cover
|
if os.name != 'nt': # pragma: win32 no cover
|
||||||
from os import openpty
|
from os import openpty
|
||||||
import termios
|
import termios
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
-e .
|
covdefaults
|
||||||
|
|
||||||
coverage
|
coverage
|
||||||
pytest
|
pytest
|
||||||
pytest-env
|
pytest-env
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,10 @@ exclude =
|
||||||
[bdist_wheel]
|
[bdist_wheel]
|
||||||
universal = True
|
universal = True
|
||||||
|
|
||||||
|
[coverage:run]
|
||||||
|
plugins = covdefaults
|
||||||
|
omit = pre_commit/resources/*
|
||||||
|
|
||||||
[mypy]
|
[mypy]
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
disallow_any_generics = true
|
disallow_any_generics = true
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ from testing.fixtures import write_config
|
||||||
from testing.util import cmd_output_mocked_pre_commit_home
|
from testing.util import cmd_output_mocked_pre_commit_home
|
||||||
from testing.util import cwd
|
from testing.util import cwd
|
||||||
from testing.util import git_commit
|
from testing.util import git_commit
|
||||||
from testing.util import xfailif_windows
|
|
||||||
|
|
||||||
|
|
||||||
def test_is_not_script():
|
def test_is_not_script():
|
||||||
|
|
@ -823,7 +822,6 @@ def test_prepare_commit_msg_legacy(
|
||||||
assert 'Signed off by: ' in f.read()
|
assert 'Signed off by: ' in f.read()
|
||||||
|
|
||||||
|
|
||||||
@xfailif_windows # pragma: windows no cover (once AP has git 2.24)
|
|
||||||
def test_pre_merge_commit_integration(tempdir_factory, store):
|
def test_pre_merge_commit_integration(tempdir_factory, store):
|
||||||
expected = re.compile(
|
expected = re.compile(
|
||||||
r'^\[INFO\] Initializing environment for .+\n'
|
r'^\[INFO\] Initializing environment for .+\n'
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ from pre_commit.prefix import Prefix
|
||||||
|
|
||||||
def test_norm_version_expanduser():
|
def test_norm_version_expanduser():
|
||||||
home = os.path.expanduser('~')
|
home = os.path.expanduser('~')
|
||||||
if os.name == 'nt': # pragma: no cover (nt)
|
if os.name == 'nt': # pragma: nt cover
|
||||||
path = r'~\python343'
|
path = r'~\python343'
|
||||||
expected_path = fr'{home}\python343'
|
expected_path = fr'{home}\python343'
|
||||||
else: # pragma: windows no cover
|
else: # pragma: nt no cover
|
||||||
path = '~/.pyenv/versions/3.4.3/bin/python'
|
path = '~/.pyenv/versions/3.4.3/bin/python'
|
||||||
expected_path = f'{home}/.pyenv/versions/3.4.3/bin/python'
|
expected_path = f'{home}/.pyenv/versions/3.4.3/bin/python'
|
||||||
result = python.norm_version(path)
|
result = python.norm_version(path)
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ def test_normexe_does_not_exist_sep():
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(os.name == 'nt', reason='posix only')
|
@pytest.mark.xfail(os.name == 'nt', reason='posix only')
|
||||||
def test_normexe_not_executable(tmpdir): # pragma: windows no cover
|
def test_normexe_not_executable(tmpdir): # pragma: win32 no cover
|
||||||
tmpdir.join('exe').ensure()
|
tmpdir.join('exe').ensure()
|
||||||
with tmpdir.as_cwd(), pytest.raises(OSError) as excinfo:
|
with tmpdir.as_cwd(), pytest.raises(OSError) as excinfo:
|
||||||
parse_shebang.normexe('./exe')
|
parse_shebang.normexe('./exe')
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ def test_versioned_python_hook(tempdir_factory, store):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@skipif_cant_run_docker # pragma: windows no cover
|
@skipif_cant_run_docker # pragma: win32 no cover
|
||||||
def test_run_a_docker_hook(tempdir_factory, store):
|
def test_run_a_docker_hook(tempdir_factory, store):
|
||||||
_test_hook_repo(
|
_test_hook_repo(
|
||||||
tempdir_factory, store, 'docker_hooks_repo',
|
tempdir_factory, store, 'docker_hooks_repo',
|
||||||
|
|
@ -206,7 +206,7 @@ def test_run_a_docker_hook(tempdir_factory, store):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@skipif_cant_run_docker # pragma: windows no cover
|
@skipif_cant_run_docker # pragma: win32 no cover
|
||||||
def test_run_a_docker_hook_with_entry_args(tempdir_factory, store):
|
def test_run_a_docker_hook_with_entry_args(tempdir_factory, store):
|
||||||
_test_hook_repo(
|
_test_hook_repo(
|
||||||
tempdir_factory, store, 'docker_hooks_repo',
|
tempdir_factory, store, 'docker_hooks_repo',
|
||||||
|
|
@ -215,7 +215,7 @@ def test_run_a_docker_hook_with_entry_args(tempdir_factory, store):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@skipif_cant_run_docker # pragma: windows no cover
|
@skipif_cant_run_docker # pragma: win32 no cover
|
||||||
def test_run_a_failing_docker_hook(tempdir_factory, store):
|
def test_run_a_failing_docker_hook(tempdir_factory, store):
|
||||||
_test_hook_repo(
|
_test_hook_repo(
|
||||||
tempdir_factory, store, 'docker_hooks_repo',
|
tempdir_factory, store, 'docker_hooks_repo',
|
||||||
|
|
@ -226,7 +226,7 @@ def test_run_a_failing_docker_hook(tempdir_factory, store):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@skipif_cant_run_docker # pragma: windows no cover
|
@skipif_cant_run_docker # pragma: win32 no cover
|
||||||
@pytest.mark.parametrize('hook_id', ('echo-entrypoint', 'echo-cmd'))
|
@pytest.mark.parametrize('hook_id', ('echo-entrypoint', 'echo-cmd'))
|
||||||
def test_run_a_docker_image_hook(tempdir_factory, store, hook_id):
|
def test_run_a_docker_image_hook(tempdir_factory, store, hook_id):
|
||||||
_test_hook_repo(
|
_test_hook_repo(
|
||||||
|
|
@ -297,7 +297,7 @@ def test_system_hook_with_spaces(tempdir_factory, store):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@skipif_cant_run_swift # pragma: windows no cover
|
@skipif_cant_run_swift # pragma: win32 no cover
|
||||||
def test_swift_hook(tempdir_factory, store):
|
def test_swift_hook(tempdir_factory, store):
|
||||||
_test_hook_repo(
|
_test_hook_repo(
|
||||||
tempdir_factory, store, 'swift_hooks_repo',
|
tempdir_factory, store, 'swift_hooks_repo',
|
||||||
|
|
@ -514,7 +514,7 @@ def test_additional_dependencies_roll_forward(tempdir_factory, store):
|
||||||
assert 'mccabe' not in cmd_output('pip', 'freeze', '-l')[1]
|
assert 'mccabe' not in cmd_output('pip', 'freeze', '-l')[1]
|
||||||
|
|
||||||
|
|
||||||
@xfailif_windows_no_ruby # pragma: windows no cover
|
@xfailif_windows_no_ruby # pragma: win32 no cover
|
||||||
def test_additional_ruby_dependencies_installed(tempdir_factory, store):
|
def test_additional_ruby_dependencies_installed(tempdir_factory, store):
|
||||||
path = make_repo(tempdir_factory, 'ruby_hooks_repo')
|
path = make_repo(tempdir_factory, 'ruby_hooks_repo')
|
||||||
config = make_config_from_repo(path)
|
config = make_config_from_repo(path)
|
||||||
|
|
@ -758,7 +758,7 @@ def local_python_config():
|
||||||
return {'repo': 'local', 'hooks': hooks}
|
return {'repo': 'local', 'hooks': hooks}
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail( # pragma: windows no cover
|
@pytest.mark.xfail( # pragma: win32 no cover
|
||||||
sys.platform == 'win32',
|
sys.platform == 'win32',
|
||||||
reason='microsoft/azure-pipelines-image-generation#989',
|
reason='microsoft/azure-pipelines-image-generation#989',
|
||||||
)
|
)
|
||||||
|
|
|
||||||
2
tox.ini
2
tox.ini
|
|
@ -7,7 +7,7 @@ passenv = HOME LOCALAPPDATA RUSTUP_HOME
|
||||||
commands =
|
commands =
|
||||||
coverage erase
|
coverage erase
|
||||||
coverage run -m pytest {posargs:tests}
|
coverage run -m pytest {posargs:tests}
|
||||||
coverage report --fail-under 100
|
coverage report
|
||||||
pre-commit install
|
pre-commit install
|
||||||
|
|
||||||
[testenv:pre-commit]
|
[testenv:pre-commit]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue