@pytest.mark.parametrize('qversion, version, op, expected', [('5.4.0', '5.4.0', operator.ge, True), ('5.4.0', '5.4.0', operator.eq, True), ('5.4.0', '5.4', operator.eq, True), ('5.4.1', '5.4', operator.ge, True), ('5.3.2', '5.4', operator.ge, False), ('5.3.0', '5.3.2', operator.ge, False)])
def test_version_check(monkeypatch, qversion, version, op, expected):
 monkeypatch.setattr('qutebrowser.utils.qtutils.qVersion', (lambda : qversion))
 assert (qtutils.version_check(version, op) == expected)

@ pytest . mark . parametrize ( 'qversion, version, op, expected' , [ ( '5.4.0' , '5.4.0' , operator . ge , True ) , ( '5.4.0' , '5.4.0' , operator . eq , True ) , ( '5.4.0' , '5.4' , operator . eq , True ) , ( '5.4.1' , '5.4' , operator . ge , True ) , ( '5.3.2' , '5.4' , operator . ge , False ) , ( '5.3.0' , '5.3.2' , operator . ge , False ) ] ) def test_version_check ( monkeypatch , qversion , version , op , expected ) : monkeypatch . setattr ( 'qutebrowser.utils.qtutils.qVersion' , ( lambda : qversion ) ) assert ( qtutils . version_check ( version , op ) == expected )
test for version_check() .