mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 09:04:41 +04:00
Replace pkg_resources.get_distribution with importlib-metadata
This commit is contained in:
parent
9c37473256
commit
ebe5132576
5 changed files with 20 additions and 7 deletions
|
|
@ -9,6 +9,7 @@ from pre_commit.util import CalledProcessError
|
|||
from pre_commit.util import clean_path_on_failure
|
||||
from pre_commit.util import cmd_output
|
||||
from pre_commit.util import memoize_by_cwd
|
||||
from pre_commit.util import parse_version
|
||||
from pre_commit.util import tmpdir
|
||||
from testing.util import cwd
|
||||
|
||||
|
|
@ -117,3 +118,9 @@ def test_cmd_output_exe_not_found():
|
|||
ret, out, _ = cmd_output('i-dont-exist', retcode=None)
|
||||
assert ret == 1
|
||||
assert out == 'Executable `i-dont-exist` not found'
|
||||
|
||||
|
||||
def test_parse_version():
|
||||
assert parse_version('0.0') == parse_version('0.0')
|
||||
assert parse_version('0.1') > parse_version('0.0')
|
||||
assert parse_version('2.1') >= parse_version('2')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue