Skip to content

Commit

Permalink
change doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Oct 4, 2023
1 parent f09f877 commit d8ad850
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/superqt/iconify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class QIconifyIcon(QIcon):
icon: `QIconifyIcon("bi:bell")`.
This class is a thin wrapper around the
[pyconify](https://github.com/pyapp-kit/pyconify) `temp_svg` function. It pulls SVGs
[pyconify](https://github.com/pyapp-kit/pyconify) `svg_path` function. It pulls SVGs
from iconify, creates a temporary SVG file and uses it as the source for a QIcon.
SVGs are cached to disk, and persist across sessions (until `pyconify.clear_cache()`
is called).
Expand Down
13 changes: 9 additions & 4 deletions tests/test_iconify.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
from typing import TYPE_CHECKING

import pytest
from qtpy.QtWidgets import QPushButton

from superqt import QIconifyIcon

if TYPE_CHECKING:
from pytestqt.qtbot import QtBot

def test_qiconify(qtbot, tmp_path, monkeypatch):
monkeypatch.setenv("PYCONIFY_CACHE", "0")

def test_qiconify(qtbot: "QtBot", monkeypatch: "pytest.MonkeyPatch") -> None:
monkeypatch.setenv("PYCONIFY_CACHE", "0")
pytest.importorskip("pyconify")
icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90, dir=tmp_path)

icon = QIconifyIcon("bi:alarm-fill", color="red", rotate=90)
assert icon.path.name.endswith(".svg")
assert icon.path.parent == tmp_path

btn = QPushButton()
qtbot.addWidget(btn)
btn.setIcon(icon)
Expand Down

0 comments on commit d8ad850

Please sign in to comment.