Skip to content

Commit

Permalink
Merge pull request #2145 from pre-commit/all-repos_autofix_covdefault…
Browse files Browse the repository at this point in the history
…s-2-1

improve coverage pragmas with covdefaults 2.1
  • Loading branch information
asottile committed Nov 30, 2021
2 parents f6547ac + 270b539 commit 3efc436
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pre_commit/constants.py
@@ -1,9 +1,9 @@
import sys

if sys.version_info < (3, 8): # pragma: no cover (<PY38)
import importlib_metadata
else: # pragma: no cover (PY38+)
if sys.version_info >= (3, 8): # pragma: >=3.8 cover
import importlib.metadata as importlib_metadata
else: # pragma: <3.8 cover
import importlib_metadata

CONFIG_FILE = '.pre-commit-config.yaml'
MANIFEST_FILE = '.pre-commit-hooks.yaml'
Expand Down
4 changes: 2 additions & 2 deletions pre_commit/util.py
Expand Up @@ -21,10 +21,10 @@

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 read_text
else: # pragma: no cover (<PY37)
else: # pragma: <3.7 cover
from importlib_resources import open_binary
from importlib_resources import read_text

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
@@ -1,4 +1,4 @@
covdefaults
covdefaults>=2.1
coverage
distlib
pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/repository_test.py
Expand Up @@ -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(
tempdir_factory, store, 'python_venv_hooks_repo',
'foo', [os.devnull],
Expand Down

0 comments on commit 3efc436

Please sign in to comment.