Skip to content

Commit caff989

Browse files
authored
Merge pull request #2583 from Cameronsplaze/main
Fixed test suite 'widgets/test_buttons.py' in Fedora 40, one pixel off
2 parents 84875ab + 79fa1c6 commit caff989

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

changes/2583.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The Button testbed tests can accommodate minor rendering differences on Fedora 40.

testbed/tests/widgets/test_button.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from unittest.mock import Mock
22

3-
from pytest import fixture
3+
from pytest import approx, fixture
44

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

4950

5051
async def test_icon(widget, probe):

0 commit comments

Comments
 (0)