Skip to content

Commit

Permalink
Merge pull request #4379 from hoylemd/improve_minversion_again
Browse files Browse the repository at this point in the history
Use packaging/pkg_resources to check minversion
  • Loading branch information
RonnyPfannschmidt authored Nov 19, 2018
2 parents a281d66 + 1568e38 commit 45c33c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Michael Droettboom
Michael Seifert
Michal Wajszczuk
Mihai Capotă
Mike Hoyle (hoylemd)
Mike Lundy
Miro Hrončok
Nathaniel Waisbrot
Expand Down
1 change: 1 addition & 0 deletions changelog/4315.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use ``pkg_resources.parse_version`` instead of ``LooseVersion`` in minversion check.
4 changes: 2 additions & 2 deletions src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import sys
import types
import warnings
from distutils.version import LooseVersion

import py
import six
from pkg_resources import parse_version
from pluggy import HookimplMarker
from pluggy import HookspecMarker
from pluggy import PluginManager
Expand Down Expand Up @@ -822,7 +822,7 @@ def _checkversion(self):

minver = self.inicfg.get("minversion", None)
if minver:
if LooseVersion(minver) > LooseVersion(pytest.__version__):
if parse_version(minver) > parse_version(pytest.__version__):
raise pytest.UsageError(
"%s:%d: requires pytest-%s, actual pytest-%s'"
% (
Expand Down

0 comments on commit 45c33c4

Please sign in to comment.