Skip to content

Bump mypy from 0.910 to 0.930 #651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 16, 2022
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
2 changes: 1 addition & 1 deletion aiohttp_session/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(
new: bool,
max_age: Optional[int] = None,
) -> None:
self._changed = False
self._changed: bool = False
self._mapping: Dict[str, Any] = {}
self._identity = identity if data != {} else None
self._new = new if data != {} else True
Expand Down
2 changes: 1 addition & 1 deletion demo/login_required_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def wrapped(
# actually load user from your database (e.g. with aiopg)
user = DATABASE[user_id]
app["user"] = user
return await fn(request, *args, **kwargs) # type: ignore[call-arg]
return await fn(request, *args, **kwargs)

return wrapped

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ flake8-bugbear==21.11.29
flake8-import-order==0.18.1
flake8-requirements==1.5.1
multidict==5.2.0
mypy==0.910
mypy==0.930
pep257==0.7.0
pre-commit==2.16.0
pynacl==1.4.0
Expand Down
9 changes: 6 additions & 3 deletions tests/test_session_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def test_invalidate() -> None:
s.invalidate()
assert s == cast(MutableMapping[str, Any], {})
assert s._changed
assert s.created is not None
# Mypy bug: https://github.com/python/mypy/issues/11853
assert s.created is not None # type: ignore[unreachable]


def test_invalidate2() -> None:
Expand All @@ -96,7 +97,8 @@ def test_invalidate2() -> None:
s.invalidate()
assert s == cast(MutableMapping[str, Any], {})
assert s._changed
assert s.created is not None
# Mypy bug: https://github.com/python/mypy/issues/11853
assert s.created is not None # type: ignore[unreachable]


def test_operations() -> None:
Expand Down Expand Up @@ -153,5 +155,6 @@ def test_change() -> None:

s.changed()
assert s._changed
# Mypy bug: https://github.com/python/mypy/issues/11853
assert s.created == created # type: ignore[unreachable]
assert cast(MutableMapping[str, Any], {"a": {"key": "value", "key2": "val2"}}) == s
assert s.created == created