Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 270b539

Browse files
committed
improve coverage pragmas with covdefaults 2.1
Committed via https://github.com/asottile/all-repos
1 parent f6547ac commit 270b539

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

pre_commit/constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import sys
22

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

88
CONFIG_FILE = '.pre-commit-config.yaml'
99
MANIFEST_FILE = '.pre-commit-hooks.yaml'

pre_commit/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
from pre_commit import parse_shebang
2323

24-
if sys.version_info >= (3, 7): # pragma: no cover (PY37+)
24+
if sys.version_info >= (3, 7): # pragma: >=3.7 cover
2525
from importlib.resources import open_binary
2626
from importlib.resources import read_text
27-
else: # pragma: no cover (<PY37)
27+
else: # pragma: <3.7 cover
2828
from importlib_resources import open_binary
2929
from importlib_resources import read_text
3030

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
covdefaults
1+
covdefaults>=2.1
22
coverage
33
distlib
44
pytest

tests/repository_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def test_python_hook_weird_setup_cfg(in_git_dir, tempdir_factory, store):
164164
)
165165

166166

167-
def test_python_venv(tempdir_factory, store): # pragma: no cover (no venv)
167+
def test_python_venv(tempdir_factory, store):
168168
_test_hook_repo(
169169
tempdir_factory, store, 'python_venv_hooks_repo',
170170
'foo', [os.devnull],

0 commit comments

Comments
 (0)