def test_settext_empty(mocker, qtbot):
 label = TextBase()
 qtbot.add_widget(label)
 mocker.patch('qutebrowser.mainwindow.statusbar.textbase.TextBase.repaint', autospec=True)
 label.setText('')
 label.repaint.assert_called_with()

def test_settext_empty ( mocker , qtbot ) : label = TextBase ( ) qtbot . add_widget ( label ) mocker . patch ( 'qutebrowser.mainwindow.statusbar.textbase.TextBase.repaint' , autospec = True ) label . setText ( '' ) label . repaint . assert_called_with ( )
make sure using settext() works and runs repaint .