Correct testbed tests of app icons.

This commit is contained in:
Russell Keith-Magee 2024-04-30 11:47:59 +08:00
parent 790e03e2f3
commit 2b8a02f3f9
No known key found for this signature in database
GPG key ID: 3D2DAB6A37BB5BC3
3 changed files with 3 additions and 9 deletions

View file

@ -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),
}

View file

@ -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)

View file

@ -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()