Skip to content

Commit

Permalink
Fix Asyncio Test Warnings (#134)
Browse files Browse the repository at this point in the history
Save is not async. Out test was making an async mock for it. Now we
don't get any warnings in test suite.
  • Loading branch information
bh2smith authored Dec 26, 2024
1 parent 373ba4e commit 5c3dc8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/unit/job_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
from unittest.mock import AsyncMock, patch
from unittest.mock import AsyncMock, Mock, patch

import pytest
from dune_client.query import QueryBase
Expand Down Expand Up @@ -36,8 +36,9 @@ async def test_metrics_collection(self, mock_metrics_push, *_):
db_url="postgresql://postgres:postgres@localhost:5432/postgres",
table_name="some_table",
)

src.fetch = AsyncMock()
dest.save = AsyncMock()
dest.save = Mock()
test_job = Job(name="job name", source=src, destination=dest)

with patch("src.metrics.env", return_value=None):
Expand Down

0 comments on commit 5c3dc8b

Please sign in to comment.