Add a simple benchmark for _update_tab_titles
This commit is contained in:
parent
cb6f4313d7
commit
97d719b179
@ -52,3 +52,21 @@ class TestTabWidget:
|
||||
|
||||
with qtbot.waitExposed(widget):
|
||||
widget.show()
|
||||
|
||||
def test_update_tab_titles_benchmark(self, benchmark, widget,
|
||||
qtbot, fake_web_tab):
|
||||
"""Benchmark for update_tab_titles."""
|
||||
widget.addTab(fake_web_tab(), 'foobar')
|
||||
widget.addTab(fake_web_tab(), 'foobar2')
|
||||
widget.addTab(fake_web_tab(), 'foobar3')
|
||||
widget.addTab(fake_web_tab(), 'foobar4')
|
||||
|
||||
with qtbot.waitExposed(widget):
|
||||
widget.show()
|
||||
|
||||
def bench():
|
||||
for _a in range(1000):
|
||||
# pylint: disable=protected-access
|
||||
widget._update_tab_titles()
|
||||
# pylint: enable=protected-access
|
||||
benchmark(bench)
|
||||
|
Loading…
Reference in New Issue
Block a user