mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Simplify the resolver zero division bug unit test
This commit is contained in:
@@ -128,24 +128,17 @@ def test_resolve_fraction_unit():
|
|||||||
def test_resolve_issue_2502():
|
def test_resolve_issue_2502():
|
||||||
"""Test https://github.com/Textualize/textual/issues/2502"""
|
"""Test https://github.com/Textualize/textual/issues/2502"""
|
||||||
|
|
||||||
widgets_fr = [Widget() for _ in range(50)]
|
widget = Widget()
|
||||||
widgets_min_width = [Widget() for _ in range(50)]
|
|
||||||
|
|
||||||
for widget in widgets_fr:
|
|
||||||
widget.styles.width = "1fr"
|
widget.styles.width = "1fr"
|
||||||
widget.styles.min_width = 1
|
widget.styles.min_width = 11
|
||||||
|
|
||||||
for widget in widgets_min_width:
|
|
||||||
widget.styles.width = 0
|
|
||||||
|
|
||||||
styles = (
|
|
||||||
widget.styles
|
|
||||||
for widget in chain.from_iterable(zip(widgets_fr, widgets_min_width))
|
|
||||||
)
|
|
||||||
|
|
||||||
assert isinstance(
|
assert isinstance(
|
||||||
resolve_fraction_unit(
|
resolve_fraction_unit(
|
||||||
styles, Size(80, 24), Size(80, 24), Fraction(10), resolve_dimension="width"
|
(widget.styles,),
|
||||||
|
Size(80, 24),
|
||||||
|
Size(80, 24),
|
||||||
|
Fraction(10),
|
||||||
|
resolve_dimension="width",
|
||||||
),
|
),
|
||||||
Fraction,
|
Fraction,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user