def METHOD_NAME(monkeypatch, caplog, value, is_valid, expected):
    versions = version.WebEngineVersions.from_pyqt('5.15.3')
    monkeypatch.setenv('QUTE_DARKMODE_VARIANT', value)
    with caplog.at_level(logging.WARNING):
        assert darkmode._variant(versions) == expected
    log_msg = 'Ignoring invalid QUTE_DARKMODE_VARIANT=invalid_value'
    assert (log_msg in caplog.messages) != is_valid