Skip to content

Commit

Permalink
Remove redundant "fmt: off" by adding trailing comma.
Browse files Browse the repository at this point in the history
Also removed redundant `easing` argument in call to `animate`. It wasn't
really needed for this particular test.
  • Loading branch information
yuvalmo committed Aug 7, 2023
1 parent c4097a7 commit a839308
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/textual/css/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,10 @@ def parse(cls, token: str) -> ScalarOffset:
New offset
"""
x, y = token.split()
# fmt: off
return cls(
Scalar.parse(x, Unit.WIDTH),
Scalar.parse(y, Unit.HEIGHT)
Scalar.parse(y, Unit.HEIGHT),
)
# fmt: on


NULL_SCALAR = ScalarOffset(Scalar.from_number(0), Scalar.from_number(0))
Expand Down
6 changes: 2 additions & 4 deletions tests/test_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def test_animate_offset(destination) -> None:
assert static.offset == Offset(0, 0)
assert static.styles.offset == NULL_SCALAR

static.styles.animate("offset", destination, duration=0.5, easing="linear")
static.styles.animate("offset", destination, duration=0.5)
start = perf_counter()

# Wait for the animation to finished
Expand All @@ -75,12 +75,10 @@ async def test_animate_offset(destination) -> None:
assert elapsed >= 0.5

# Check the offset reached the destination
# fmt: off
assert static.styles.offset == ScalarOffset(
Scalar(10, Unit.CELLS, Unit.WIDTH),
Scalar(5, Unit.CELLS, Unit.HEIGHT)
Scalar(5, Unit.CELLS, Unit.HEIGHT),
)
# fmt: on


async def test_scheduling_animation() -> None:
Expand Down

0 comments on commit a839308

Please sign in to comment.