Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Test icons for naming changes in QtAwesome #13881

Merged
merged 1 commit into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ else
# Install qtconsole from Github
pip install git+https://github.com/jupyter/qtconsole.git

# Pin QtAwesome to 0.7.3 until we can update to 1.0.0
pip install qtawesome==0.7.3
# Install QtAwesome from Github
pip install git+https://github.com/spyder-ide/qtawesome.git

# Remove packages we have subrepos for
pip uninstall spyder-kernels -q -y
Expand Down
33 changes: 33 additions & 0 deletions spyder/utils/tests/test_icons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#

"""Tests for conda.py"""

# Third party imports
import pytest
from qtpy.QtGui import QIcon

# Local imports
from spyder.utils import icon_manager as ima
from spyder.utils.qthelpers import qapplication


def test_icon_mapping():
"""Test that all the entries on the icon dict for QtAwesome are valid."""
# Needed instance of QApplication to run QtAwesome
qapp = qapplication()
# Check each entry of the dict and try to get the respective icon
icons_dict = ima._qtaargs
for key in icons_dict:
try:
assert isinstance(ima.icon(key), QIcon)
except Exception as e:
print('Invalid icon name:', key)
raise e


if __name__ == "__main__":
pytest.main()