def require_version(minver=None, maxver=None):
def parse(string, default=None):<EOL><INDENT>string = string or default<EOL>try:<EOL><INDENT>return tuple(int(v) for v in string.split("<STR_LIT:.>"))<EOL><DEDENT>except ValueError as exc:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(<EOL>string=string<EOL>)<EOL>) from exc<EOL><DEDENT><DEDENT>def check_require_version(f):<EOL><INDENT>current = sys.version_info[:<NUM_LIT:3>]<EOL>if parse(minver, "<STR_LIT:0>") < current <= parse(maxver, "<STR_LIT:4>"):<EOL><INDENT>return f<EOL><DEDENT>str_version = "<STR_LIT:.>".join(str(v) for v in sys.version_info)<EOL>@functools.wraps(f)<EOL>def new_f(*args, **kwargs):<EOL><INDENT>if minver is not None:<EOL><INDENT>pytest.skip(<EOL>"<STR_LIT>" % (minver, str_version)<EOL>)<EOL><DEDENT>elif maxver is not None:<EOL><INDENT>pytest.skip(<EOL>"<STR_LIT>" % (maxver, str_version)<EOL>)<EOL><DEDENT><DEDENT>return new_f<EOL><DEDENT>return check_require_version<EOL>
Compare version of python interpreter to the given one. Skip the test
    if older.