Merge pull request #4308 from asottile/compare_versions_with_loose_version
Don't string-compare version numbers
This commit is contained in:
commit
176d27440c
|
@ -0,0 +1 @@
|
|||
Parse ``minversion`` as an actual version and not as dot-separated strings.
|
|
@ -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'"
|
||||
% (
|
||||
|
|
Loading…
Reference in New Issue