Add benchmark for _tab_pinned

This commit is contained in:
Jay Kamat 2018-09-23 22:56:41 -07:00
parent e9ca4c4295
commit 77703c5263
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -20,6 +20,7 @@
"""Tests for the custom TabWidget/TabBar.""" """Tests for the custom TabWidget/TabBar."""
import pytest import pytest
import functools
from PyQt5.QtGui import QIcon, QPixmap from PyQt5.QtGui import QIcon, QPixmap
@ -141,3 +142,9 @@ class TestTabWidget:
browser.shutdown() browser.shutdown()
benchmark(_run_bench) benchmark(_run_bench)
def test_tab_pinned_benchmark(self, benchmark, widget, fake_web_tab):
"""Benchmark for _tab_pinned."""
widget.addTab(fake_web_tab(), 'foobar')
tab_bar = widget.tabBar()
benchmark(functools.partial(tab_bar._tab_pinned, 0))