Skip to content

Commit

Permalink
Fix tests with aiohttp >= 3.10.0
Browse files Browse the repository at this point in the history
aiohttp 3.10.0 removed the ability to create `aiohttp.ClientSession`
instances without a running event loop (see
aio-libs/aiohttp#8583), but a few of blinkpy's
tests relied on that.
  • Loading branch information
cjwatson committed Aug 5, 2024
1 parent 0a3ba30 commit 72133dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class TestAPI(IsolatedAsyncioTestCase):
"""Test the API class in blinkpy."""

def setUp(self):
async def asyncSetUp(self):
"""Set up Login Handler."""
self.blink = Blink(session=mock.AsyncMock())
self.auth = Auth()
Expand Down
8 changes: 4 additions & 4 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class TestAuth(IsolatedAsyncioTestCase):
"""Test the Auth class in blinkpy."""

def setUp(self):
async def asyncSetUp(self):
"""Set up Login Handler."""
self.auth = Auth()

Expand All @@ -29,7 +29,7 @@ def tearDown(self):

@mock.patch("blinkpy.helpers.util.gen_uid")
@mock.patch("blinkpy.auth.util.getpass")
def test_empty_init(self, getpwd, genuid):
async def test_empty_init(self, getpwd, genuid):
"""Test initialization with no params."""
auth = Auth()
self.assertDictEqual(auth.data, {})
Expand All @@ -47,7 +47,7 @@ def test_empty_init(self, getpwd, genuid):

@mock.patch("blinkpy.helpers.util.gen_uid")
@mock.patch("blinkpy.auth.util.getpass")
def test_barebones_init(self, getpwd, genuid):
async def test_barebones_init(self, getpwd, genuid):
"""Test basebones initialization."""
login_data = {"username": "foo", "password": "bar"}
auth = Auth(login_data)
Expand All @@ -64,7 +64,7 @@ def test_barebones_init(self, getpwd, genuid):
}
self.assertDictEqual(auth.data, expected_data)

def test_full_init(self):
async def test_full_init(self):
"""Test full initialization."""
login_data = {
"username": "foo",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_blinkpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def tearDown(self):
"""Cleanup blink test object."""
self.blink = None

def test_initialization(self):
async def test_initialization(self):
"""Verify we can initialize blink."""
blink = Blink()
self.assertEqual(blink.version, __version__)
Expand Down

0 comments on commit 72133dd

Please sign in to comment.