Don't string-compare version numbers

This commit is contained in:
Anthony Sottile 2018-11-04 17:28:35 -08:00
parent 4aa3c4fa2b
commit 85a3333824
2 changed files with 3 additions and 3 deletions

View File

@ -0,0 +1 @@
Parse ``minversion`` as an actual version and not as dot-separated strings.

View File

@ -11,6 +11,7 @@ import shlex
import sys
import types
import warnings
from distutils.version import LooseVersion
import py
import six
@ -816,9 +817,7 @@ class Config(object):
minver = self.inicfg.get("minversion", None)
if minver:
ver = minver.split(".")
myver = pytest.__version__.split(".")
if myver < ver:
if LooseVersion(minver) > LooseVersion(pytest.__version__):
raise pytest.UsageError(
"%s:%d: requires pytest-%s, actual pytest-%s'"
% (