Use covdefaults to handle coveragerc

This commit is contained in:
Anthony Sottile 2020-02-29 14:00:31 -08:00
parent 4a3b10f0ed
commit 67c1beb322
19 changed files with 42 additions and 81 deletions

View file

@ -21,12 +21,12 @@ BUILD_DIR = '.build'
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)
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]:
envdir = prefix.path(
helpers.environment_dir(ENVIRONMENT_DIR, C.DEFAULT),
@ -37,7 +37,7 @@ def in_env(prefix: Prefix) -> Generator[None, None, None]:
def install_environment(
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_no_additional_deps('swift', additional_dependencies)
directory = prefix.path(
@ -59,6 +59,6 @@ def run_hook(
hook: Hook,
file_args: Sequence[str],
color: bool,
) -> Tuple[int, bytes]: # pragma: windows no cover
) -> Tuple[int, bytes]: # pragma: win32 no cover
with in_env(hook.prefix):
return helpers.run_xargs(hook, hook.cmd, file_args, color=color)