Skip to content

Commit

Permalink
Merge pull request #2583 from Cameronsplaze/main
Browse files Browse the repository at this point in the history
Fixed test suite 'widgets/test_buttons.py' in Fedora 40, one pixel off
  • Loading branch information
freakboy3742 committed May 20, 2024
2 parents 84875ab + 79fa1c6 commit caff989
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions changes/2583.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Button testbed tests can accommodate minor rendering differences on Fedora 40.
5 changes: 3 additions & 2 deletions testbed/tests/widgets/test_button.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest.mock import Mock

from pytest import fixture
from pytest import approx, fixture

import toga
from toga.colors import TRANSPARENT
Expand Down Expand Up @@ -44,7 +44,8 @@ async def test_text(widget, probe):
expected = str(text).split("\n")[0]
assert widget.text == expected
assert probe.text == expected
assert probe.height == initial_height
# GTK rendering can result in a very minor change in button height
assert probe.height == approx(initial_height, abs=1)


async def test_icon(widget, probe):
Expand Down

0 comments on commit caff989

Please sign in to comment.