Skip to content

Commit

Permalink
Update test case names (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdusek authored Feb 20, 2024
1 parent a869909 commit b8c4a81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/unit/_utils/test_recurring_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ def delay() -> timedelta:


@pytest.mark.asyncio()
async def test__recurring_task__init(function: AsyncMock, delay: timedelta) -> None:
async def test_init(function: AsyncMock, delay: timedelta) -> None:
rt = RecurringTask(function, delay)
assert rt.func == function
assert rt.delay == delay
assert rt.task is None


@pytest.mark.asyncio()
async def test__recurring_task__start_and_stop(function: AsyncMock, delay: timedelta) -> None:
async def test_start_and_stop(function: AsyncMock, delay: timedelta) -> None:
rt = RecurringTask(function, delay)

rt.start()
Expand All @@ -44,7 +44,7 @@ async def test__recurring_task__start_and_stop(function: AsyncMock, delay: timed


@pytest.mark.asyncio()
async def test__recurring_task__execution(function: AsyncMock, delay: timedelta) -> None:
async def test_execution(function: AsyncMock, delay: timedelta) -> None:
task = RecurringTask(function, delay)

task.start()
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_log_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ def get_log_record(level: int, msg: str, exc_info: logging._SysExcInfoType | Non
],
ids=['debug', 'info', 'warning', 'error'],
)
def test__log_formatter__msg(level: int, msg: str, expected: str) -> None:
def test_formatted_message(level: int, msg: str, expected: str) -> None:
formatter = CrawleeLogFormatter()
record = get_log_record(level, msg)
formatted_message = formatter.format(record)
assert formatted_message == expected


def test__log_formatter__with_exception() -> None:
def test_formatting_with_exception() -> None:
formatter = CrawleeLogFormatter()
try:
raise ValueError('This is a test exception')
Expand All @@ -51,7 +51,7 @@ def test__log_formatter__with_exception() -> None:
assert 'ValueError: This is a test exception' in formatted_message


def test__log_formatter__without_name() -> None:
def test_formatter_without_name() -> None:
formatter = CrawleeLogFormatter(include_logger_name=False)
record = get_log_record(logging.INFO, 'Info message without name')
formatted_message = formatter.format(record)
Expand Down

0 comments on commit b8c4a81

Please sign in to comment.