def test_tab_change(percentage, fake_web_tab):
 percentage.set_perc(x=None, y=10)
 tab = fake_web_tab(scroll_pos_perc=(0, 20))
 percentage.on_tab_changed(tab)
 assert (percentage.text() == '[20%]')

def test_tab_change ( percentage , fake_web_tab ) : percentage . set_perc ( x = None , y = 10 ) tab = fake_web_tab ( scroll_pos_perc = ( 0 , 20 ) ) percentage . on_tab_changed ( tab ) assert ( percentage . text ( ) == '[20%]' )
make sure the percentage gets changed correctly when switching tabs .