Skip to content

Commit

Permalink
MOTOR-1218: Upgrade to require aiohttp >=3.8 and avoid 3.8.6 (mongodb…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibola authored Jan 30, 2024
1 parent dc8b329 commit b578122
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ srv = [
"pymongo[srv]>=4.5,<5",
]
test = [
"pytest>=7", "mockupdb", "tornado>=5", "aiohttp<3.8.6", "motor[encryption]"
"pytest>=7", "mockupdb", "tornado>=5", "aiohttp>=3.8,!=3.8.6", "motor[encryption]"
]
zstd = [
"pymongo[zstd]>=4.5,<5",
Expand Down Expand Up @@ -94,6 +94,7 @@ warn_redundant_casts = true
warn_unreachable = true
disable_error_code = ["type-arg"]
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
exclude = ["aiohttp"] # Remove when drop support for 3.7

[tool.pytest.ini_options]
minversion = "7"
Expand Down
2 changes: 1 addition & 1 deletion test/asyncio_tests/test_aiohttp_gridfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async def test_content_type(self):
response = await method("/fs/" + filename)
self.assertEqual(200, response.status)
# mimetypes are platform-defined, be fuzzy
self.assertIn(expected_type, response.headers["Content-Type"].lower())
self.assertIn(expected_type, response.content_type)

@asyncio_test
async def test_post(self):
Expand Down
8 changes: 7 additions & 1 deletion test/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from functools import wraps
from test.utils import create_user
from test.version import Version
from typing import TYPE_CHECKING
from unittest import SkipTest

import pymongo.errors
Expand Down Expand Up @@ -50,7 +51,12 @@

HAVE_AIOHTTP = True
try:
import aiohttp
# Remove when we drop support for 3.7
if TYPE_CHECKING:
HAVE_AIOHTTP = False
aiohttp = None
else:
import aiohttp
except ImportError:
HAVE_AIOHTTP = False
aiohttp = None
Expand Down

0 comments on commit b578122

Please sign in to comment.