Skip to content

Commit 5c4bc93

Browse files
authored
Fix uilabel tests on windows (#2362)
1 parent 798ae21 commit 5c4bc93

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/unit/gui/test_uilabel.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_constructor_only_text_no_size(window):
1212
label = UILabel(text="Example")
1313

1414
assert label.rect.width == pytest.approx(
15-
63, abs=7
15+
63, abs=10
1616
) # on windows the width differs about 6 pixel
1717
assert label.rect.height == pytest.approx(19, abs=1)
1818

@@ -48,21 +48,21 @@ def test_constructor_adaptive_width_support_for_multiline_text(window):
4848

4949
def test_with_border_keeps_previous_size(window):
5050
label = UILabel(text="Example")
51-
assert label.rect.width == pytest.approx(63, abs=7)
51+
assert label.rect.width == pytest.approx(63, abs=10)
5252
assert label.rect.height == pytest.approx(19, abs=6)
5353

5454
label.with_border()
55-
assert label.rect.width == pytest.approx(63, abs=7)
55+
assert label.rect.width == pytest.approx(63, abs=10)
5656
assert label.rect.height == pytest.approx(19, abs=6)
5757

5858

5959
def test_with_padding_keeps_previous_size(window):
6060
label = UILabel(text="Example")
61-
assert label.rect.width == pytest.approx(63, abs=7)
61+
assert label.rect.width == pytest.approx(63, abs=10)
6262
assert label.rect.height == pytest.approx(19, abs=6)
6363

6464
label.with_padding(all=2)
65-
assert label.rect.width == pytest.approx(63, abs=7)
65+
assert label.rect.width == pytest.approx(63, abs=10)
6666
assert label.rect.height == pytest.approx(19, abs=6)
6767

6868

@@ -193,7 +193,7 @@ def test_integration_with_layout_fit_to_content(ui):
193193
ui.execute_layout()
194194

195195
# auto size should fit the text
196-
assert label.rect.width == pytest.approx(63, abs=7)
196+
assert label.rect.width == pytest.approx(63, abs=10)
197197
assert label.rect.height == pytest.approx(19, abs=6)
198198

199199
# even when text changed
@@ -221,7 +221,7 @@ def test_fit_content_overrides_width(ui):
221221

222222
label.fit_content()
223223

224-
assert label.rect.width == pytest.approx(63, abs=7)
224+
assert label.rect.width == pytest.approx(63, abs=10)
225225
assert label.rect.height == pytest.approx(19, abs=6)
226226

227227

0 commit comments

Comments
 (0)