From 2b8a02f3f96495f4711155eca8fa8f92303d8ff8 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 30 Apr 2024 11:47:59 +0800 Subject: [PATCH] Correct testbed tests of app icons. --- cocoa/tests_backend/app.py | 1 + testbed/tests/app/test_app.py | 2 +- testbed/tests/test_icons.py | 9 +-------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/cocoa/tests_backend/app.py b/cocoa/tests_backend/app.py index 6b3eda816..6fad33f81 100644 --- a/cocoa/tests_backend/app.py +++ b/cocoa/tests_backend/app.py @@ -91,6 +91,7 @@ class AppProbe(BaseProbe): assert mid_color in { (130, 100, 57, 255), (130, 109, 66, 255), + (138, 107, 64, 255), (138, 108, 64, 255), (149, 119, 73, 255), } diff --git a/testbed/tests/app/test_app.py b/testbed/tests/app/test_app.py index 1fddca8cc..2798debc8 100644 --- a/testbed/tests/app/test_app.py +++ b/testbed/tests/app/test_app.py @@ -600,6 +600,6 @@ async def test_app_icon(app, app_probe): app_probe.assert_app_icon("resources/alt-icon") # Reset the icon to the default - app.icon = None + app.icon = toga.Icon.APP_ICON await app_probe.redraw("Revert app icon to default") app_probe.assert_app_icon(None) diff --git a/testbed/tests/test_icons.py b/testbed/tests/test_icons.py index 275357985..b0754cba1 100644 --- a/testbed/tests/test_icons.py +++ b/testbed/tests/test_icons.py @@ -1,7 +1,5 @@ import re -import sys from importlib import import_module -from pathlib import Path import pytest @@ -27,14 +25,9 @@ async def test_icon(app): probe.assert_icon_content(probe.alternate_resource) -@pytest.mark.skipif( - Path(sys.executable).stem.startswith("python"), - reason="Can't test app icon in a dev mode test", -) async def test_app_icon(app): """The app icon can be obtained.""" - icon = toga.Icon(None) - probe = icon_probe(app, icon) + probe = icon_probe(app, toga.Icon.APP_ICON) probe.assert_app_icon_content()