Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
aiohttp==3.13.5
aiohttp==3.14.0
requests==2.34.2
pytz==2026.2
pytest-asyncio==1.3.0
aioresponses==0.7.8
pytest-asyncio==1.4.0
mock==5.2.0
pytest==9.0.3
yarl==1.24.2
Expand All @@ -13,4 +12,4 @@ pylint==4.0.5
isort==8.0.1
pytest-cov==7.1.0
pytest-html==4.2.0
ruff==0.15.14
ruff==0.15.15
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
version=__version__,
name="pirateweather",
packages=find_packages(),
install_requires=["requests==2.34.2", "pytz==2026.2", "aiohttp==3.13.5"],
install_requires=["requests==2.34.2", "pytz==2026.2", "aiohttp==3.14.0"],
description="The Pirate Weather API wrapper",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
Expand Down
14 changes: 9 additions & 5 deletions tests/test_forecast.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import asyncio
import copy
import os
import re
import sys
from datetime import datetime
from unittest import mock
from unittest.mock import AsyncMock

import aiohttp
import aioresponses
import pytest

from pirate_weather.api import PirateWeather, PirateWeatherAsync
Expand All @@ -31,10 +30,15 @@ def forecast_sync():
def forecast_async():
async def get_async_data():
pirate_weather = PirateWeatherAsync("api_key")
with aioresponses.aioresponses() as resp:
resp.get(re.compile(".+"), status=200, payload=copy.deepcopy(DATA))

async with aiohttp.ClientSession() as session:
mock_resp = AsyncMock()
mock_resp.status = 200
mock_resp.json = AsyncMock(return_value=copy.deepcopy(DATA))
mock_resp.__aenter__ = AsyncMock(return_value=mock_resp)
mock_resp.__aexit__ = AsyncMock(return_value=None)

async with aiohttp.ClientSession() as session:
with mock.patch.object(session, "get", return_value=mock_resp):
result = await pirate_weather.get_forecast(
DATA["latitude"],
DATA["longitude"],
Expand Down
Loading