Skip to content

Commit

Permalink
Better test reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mbsantiago committed Sep 4, 2024
1 parent 66cdb63 commit b7b613a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions back/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ known-local-folder = ["src", "whombat"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
log_level = "INFO"
addopts = "--durations=5 --disable-warnings --color=auto --code-highlight=yes"
asyncio_default_fixture_loop_scope = "session"
19 changes: 17 additions & 2 deletions back/tests/test_api/test_clips.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Test suite for API clip functions."""

import datetime
from uuid import uuid4

import pytest
Expand Down Expand Up @@ -186,11 +187,24 @@ async def test_get_clips_with_limit(
):
"""Test getting clips with a limit."""
# Arrange
now = datetime.datetime.now(datetime.timezone.utc)
await api.clips.create_many_without_duplicates(
session,
data=[
dict(recording_id=recording.id, start_time=0.0, end_time=0.5),
dict(recording_id=recording.id, start_time=0.5, end_time=1.0),
dict(
recording_id=recording.id,
start_time=0.0,
end_time=0.5,
created_on=now,
),
dict(
recording_id=recording.id,
start_time=0.5,
end_time=1.0,
# NOTE: Need to be explicit with time creation
# since sqlite is not very precise with time.
created_on=now + datetime.timedelta(seconds=1),
),
],
)

Expand All @@ -205,6 +219,7 @@ async def test_get_clips_with_limit(
assert db_clips[0].recording == recording
assert db_clips[0].start_time == 0.5
assert db_clips[0].end_time == 1.0
assert False


async def test_get_clips_with_offset(
Expand Down

0 comments on commit b7b613a

Please sign in to comment.