Don't string-compare version numbers
This commit is contained in:
parent
4aa3c4fa2b
commit
85a3333824
|
@ -0,0 +1 @@
|
||||||
|
Parse ``minversion`` as an actual version and not as dot-separated strings.
|
|
@ -11,6 +11,7 @@ import shlex
|
||||||
import sys
|
import sys
|
||||||
import types
|
import types
|
||||||
import warnings
|
import warnings
|
||||||
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
import py
|
import py
|
||||||
import six
|
import six
|
||||||
|
@ -816,9 +817,7 @@ class Config(object):
|
||||||
|
|
||||||
minver = self.inicfg.get("minversion", None)
|
minver = self.inicfg.get("minversion", None)
|
||||||
if minver:
|
if minver:
|
||||||
ver = minver.split(".")
|
if LooseVersion(minver) > LooseVersion(pytest.__version__):
|
||||||
myver = pytest.__version__.split(".")
|
|
||||||
if myver < ver:
|
|
||||||
raise pytest.UsageError(
|
raise pytest.UsageError(
|
||||||
"%s:%d: requires pytest-%s, actual pytest-%s'"
|
"%s:%d: requires pytest-%s, actual pytest-%s'"
|
||||||
% (
|
% (
|
||||||
|
|
Loading…
Reference in New Issue