diff --git a/AUTHORS b/AUTHORS index 777eda324..1316f7b8f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -158,6 +158,7 @@ Michael Droettboom Michael Seifert Michal Wajszczuk Mihai Capotă +Mike Hoyle (hoylemd) Mike Lundy Miro Hrončok Nathaniel Waisbrot diff --git a/changelog/4315.trivial.rst b/changelog/4315.trivial.rst new file mode 100644 index 000000000..ee7266aa0 --- /dev/null +++ b/changelog/4315.trivial.rst @@ -0,0 +1 @@ +Use ``pkg_resources.parse_version`` instead of ``LooseVersion`` in minversion check. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 0c3ecdcce..26a0973ca 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -11,10 +11,10 @@ import shlex 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 @@ -822,7 +822,7 @@ class Config(object): 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'" % (