Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve coverage pragmas with covdefaults 2.1 #2145

Merged
merged 1 commit into from Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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