File: test_iconify.py

package info (click to toggle)
superqt 0.7.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,320 kB
  • sloc: python: 9,108; makefile: 16; sh: 12
file content (23 lines) | stat: -rw-r--r-- 602 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from typing import TYPE_CHECKING

import pytest
from qtpy.QtGui import QIcon
from qtpy.QtWidgets import QPushButton

from superqt import QIconifyIcon

if TYPE_CHECKING:
    from pytestqt.qtbot import QtBot


def test_qiconify(qtbot: "QtBot", monkeypatch: "pytest.MonkeyPatch") -> None:
    monkeypatch.setenv("PYCONIFY_CACHE", "0")
    pytest.importorskip("pyconify")

    icon = QIconifyIcon("bi:alarm-fill", color="red", flip="vertical")
    icon.addKey("bi:alarm", color="blue", rotate=90, state=QIcon.State.On)

    btn = QPushButton()
    qtbot.addWidget(btn)
    btn.setIcon(icon)
    btn.show()