def test_patched_no_errwindow(capfd, monkeypatch):
 monkeypatch.setattr('qutebrowser.misc.checkpyver.sys.argv', [sys.argv[0], '--no-err-windows'])
 monkeypatch.setattr('qutebrowser.misc.checkpyver.sys.hexversion', 50331648)
 monkeypatch.setattr('qutebrowser.misc.checkpyver.sys.exit', (lambda status: None))
 checkpyver.check_python_version()
 (stdout, stderr) = capfd.readouterr()
 assert (not stdout)
 assert re.match(TEXT, stderr), stderr

def test_patched_no_errwindow ( capfd , monkeypatch ) : monkeypatch . setattr ( 'qutebrowser.misc.checkpyver.sys.argv' , [ sys . argv [ 0 ] , '--no-err-windows' ] ) monkeypatch . setattr ( 'qutebrowser.misc.checkpyver.sys.hexversion' , 50331648 ) monkeypatch . setattr ( 'qutebrowser.misc.checkpyver.sys.exit' , ( lambda status : None ) ) checkpyver . check_python_version ( ) ( stdout , stderr ) = capfd . readouterr ( ) assert ( not stdout ) assert re . match ( TEXT , stderr ) , stderr
test with a patched sys .