mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 16:44:42 +04:00
Use covdefaults to handle coveragerc
This commit is contained in:
parent
4a3b10f0ed
commit
67c1beb322
19 changed files with 42 additions and 81 deletions
|
|
@ -25,7 +25,6 @@ from testing.fixtures import write_config
|
|||
from testing.util import cmd_output_mocked_pre_commit_home
|
||||
from testing.util import cwd
|
||||
from testing.util import git_commit
|
||||
from testing.util import xfailif_windows
|
||||
|
||||
|
||||
def test_is_not_script():
|
||||
|
|
@ -823,7 +822,6 @@ def test_prepare_commit_msg_legacy(
|
|||
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):
|
||||
expected = re.compile(
|
||||
r'^\[INFO\] Initializing environment for .+\n'
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ from pre_commit.prefix import Prefix
|
|||
|
||||
def test_norm_version_expanduser():
|
||||
home = os.path.expanduser('~')
|
||||
if os.name == 'nt': # pragma: no cover (nt)
|
||||
if os.name == 'nt': # pragma: nt cover
|
||||
path = r'~\python343'
|
||||
expected_path = fr'{home}\python343'
|
||||
else: # pragma: windows no cover
|
||||
else: # pragma: nt no cover
|
||||
path = '~/.pyenv/versions/3.4.3/bin/python'
|
||||
expected_path = f'{home}/.pyenv/versions/3.4.3/bin/python'
|
||||
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')
|
||||
def test_normexe_not_executable(tmpdir): # pragma: windows no cover
|
||||
def test_normexe_not_executable(tmpdir): # pragma: win32 no cover
|
||||
tmpdir.join('exe').ensure()
|
||||
with tmpdir.as_cwd(), pytest.raises(OSError) as excinfo:
|
||||
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):
|
||||
_test_hook_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):
|
||||
_test_hook_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):
|
||||
_test_hook_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'))
|
||||
def test_run_a_docker_image_hook(tempdir_factory, store, hook_id):
|
||||
_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):
|
||||
_test_hook_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]
|
||||
|
||||
|
||||
@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):
|
||||
path = make_repo(tempdir_factory, 'ruby_hooks_repo')
|
||||
config = make_config_from_repo(path)
|
||||
|
|
@ -758,7 +758,7 @@ def local_python_config():
|
|||
return {'repo': 'local', 'hooks': hooks}
|
||||
|
||||
|
||||
@pytest.mark.xfail( # pragma: windows no cover
|
||||
@pytest.mark.xfail( # pragma: win32 no cover
|
||||
sys.platform == 'win32',
|
||||
reason='microsoft/azure-pipelines-image-generation#989',
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue