mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
Merge pull request #2145 from pre-commit/all-repos_autofix_covdefaults-2-1
improve coverage pragmas with covdefaults 2.1
This commit is contained in:
commit
3efc436d71
4 changed files with 7 additions and 7 deletions
|
|
@ -1,9 +1,9 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.version_info < (3, 8): # pragma: no cover (<PY38)
|
if sys.version_info >= (3, 8): # pragma: >=3.8 cover
|
||||||
import importlib_metadata
|
|
||||||
else: # pragma: no cover (PY38+)
|
|
||||||
import importlib.metadata as importlib_metadata
|
import importlib.metadata as importlib_metadata
|
||||||
|
else: # pragma: <3.8 cover
|
||||||
|
import importlib_metadata
|
||||||
|
|
||||||
CONFIG_FILE = '.pre-commit-config.yaml'
|
CONFIG_FILE = '.pre-commit-config.yaml'
|
||||||
MANIFEST_FILE = '.pre-commit-hooks.yaml'
|
MANIFEST_FILE = '.pre-commit-hooks.yaml'
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@ import yaml
|
||||||
|
|
||||||
from pre_commit import parse_shebang
|
from pre_commit import parse_shebang
|
||||||
|
|
||||||
if sys.version_info >= (3, 7): # pragma: no cover (PY37+)
|
if sys.version_info >= (3, 7): # pragma: >=3.7 cover
|
||||||
from importlib.resources import open_binary
|
from importlib.resources import open_binary
|
||||||
from importlib.resources import read_text
|
from importlib.resources import read_text
|
||||||
else: # pragma: no cover (<PY37)
|
else: # pragma: <3.7 cover
|
||||||
from importlib_resources import open_binary
|
from importlib_resources import open_binary
|
||||||
from importlib_resources import read_text
|
from importlib_resources import read_text
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
covdefaults
|
covdefaults>=2.1
|
||||||
coverage
|
coverage
|
||||||
distlib
|
distlib
|
||||||
pytest
|
pytest
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ def test_python_hook_weird_setup_cfg(in_git_dir, tempdir_factory, store):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_python_venv(tempdir_factory, store): # pragma: no cover (no venv)
|
def test_python_venv(tempdir_factory, store):
|
||||||
_test_hook_repo(
|
_test_hook_repo(
|
||||||
tempdir_factory, store, 'python_venv_hooks_repo',
|
tempdir_factory, store, 'python_venv_hooks_repo',
|
||||||
'foo', [os.devnull],
|
'foo', [os.devnull],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue