From 77703c5263c7bf52100fde86cebc48af3558d840 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sun, 23 Sep 2018 22:56:41 -0700 Subject: [PATCH] Add benchmark for _tab_pinned --- tests/unit/mainwindow/test_tabwidget.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unit/mainwindow/test_tabwidget.py b/tests/unit/mainwindow/test_tabwidget.py index de68481a9..cbc59cdf9 100644 --- a/tests/unit/mainwindow/test_tabwidget.py +++ b/tests/unit/mainwindow/test_tabwidget.py @@ -20,6 +20,7 @@ """Tests for the custom TabWidget/TabBar.""" import pytest +import functools from PyQt5.QtGui import QIcon, QPixmap @@ -141,3 +142,9 @@ class TestTabWidget: browser.shutdown() 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))