Skip to content

Commit

Permalink
Merge branch 'master' into fix/NotImplementedError
Browse files Browse the repository at this point in the history
  • Loading branch information
bluet authored Dec 7, 2023
2 parents 272a9cd + 4c7a44a commit 65bf46d
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-test-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
poetry-version: ["1.2.2", "1.3.1"]

steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,4 @@ pip-selfcheck.json

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

docs/source/_build/
83 changes: 78 additions & 5 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [

[tool.poetry.dependencies]
python = "^3.8"
aiohttp = "^3.9.0"
aiohttp = "3.9.1"
aiodns = "^3.0.0"
attrs = "^22.1.0"
maxminddb = "^2.2.0"
Expand Down
12 changes: 5 additions & 7 deletions tests/test_resolver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import socket
from unittest.mock import AsyncMock

import pytest

Expand Down Expand Up @@ -34,15 +35,12 @@ def test_get_ip_info(resolver):
@pytest.mark.asyncio
async def test_get_real_ext_ip(event_loop, mocker, resolver):
async def f(*args, **kwargs):
async def side_effect(*args, **kwargs):
return '127.0.0.1\n'
return '127.0.0.1\n'

resp = mocker.Mock()
resp.text.side_effect = side_effect
return resp
resp = AsyncMock()
resp.text = f

# https://github.com/pytest-dev/pytest-mock#note-about-usage-as-context-manager
mocker.patch('aiohttp.client.ClientSession._request', side_effect=f)
mocker.patch('aiohttp.client.ClientSession._request', return_value=resp)
assert await resolver.get_real_ext_ip() == '127.0.0.1'


Expand Down

0 comments on commit 65bf46d

Please sign in to comment.