Skip to content

Commit

Permalink
Update test mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps committed Jun 4, 2024
1 parent 81edf93 commit 15b4624
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 19 deletions.
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pytest-asyncio = "*"
pytest-cov = "*"
asynctest = "*"
python-coveralls = "*"
mock = "*"
pytest-mock = "*"
vulture = "*"
freezegun = "*"
Expand Down
17 changes: 4 additions & 13 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tests/integration_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from unittest import mock

import aio_pika
import mock
import pytest

from service import config
Expand Down
7 changes: 4 additions & 3 deletions tests/unit_tests/test_league_service.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from unittest import mock

import pytest
from asynctest import CoroutineMock
from sqlalchemy import select

from service.db.models import league_score_journal
Expand Down Expand Up @@ -41,7 +42,7 @@ async def test_enqueue_manual_initialization(
):
service = uninitialized_service
await service.initialize()
service._rate_single_league = CoroutineMock()
service._rate_single_league = mock.AsyncMock()
await service.enqueue(rating_change_message)
await service.shutdown()

Expand All @@ -58,7 +59,7 @@ async def test_double_initialization_does_not_start_second_worker(league_service

async def test_enqueue_initialized(league_service, rating_change_message):
service = league_service
service._rate_single_league = CoroutineMock()
service._rate_single_league = mock.AsyncMock()

await service.enqueue(rating_change_message)
await service.shutdown()
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_season_generator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime, timedelta
from unittest import mock

import mock
import pytest
from freezegun import freeze_time
from sqlalchemy import select
Expand Down

0 comments on commit 15b4624

Please sign in to comment.