Skip to content

Commit

Permalink
Bump mypy version
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Oct 11, 2020
1 parent 9a70da9 commit d41493d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ black-check:
fi

mypy:
mypy multidict tests
mypy --show-error-codes multidict tests

lint: flake8 black-check mypy isort-check check_changes

Expand Down
2 changes: 1 addition & 1 deletion requirements/lint.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mypy==0.782; implementation_name=="cpython"
mypy==0.790; implementation_name=="cpython"
flake8==3.8.4
flake8-pyi==20.5.0; python_version >= "3.6"
black==20.8b1; python_version >= "3.6"
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@

extensions = [
Extension(
"multidict._multidict", ["multidict/_multidict.c"], extra_compile_args=CFLAGS,
"multidict._multidict",
["multidict/_multidict.c"],
extra_compile_args=CFLAGS,
),
]

Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
)


@pytest.fixture(
@pytest.fixture( # type: ignore[call-overload]
scope="session",
params=[
pytest.param("multidict._multidict", marks=OPTIONAL_CYTHON),
pytest.param("multidict._multidict", marks=OPTIONAL_CYTHON), # type: ignore
"multidict._multidict_py",
],
)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_istr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import gc
import sys
from typing import Type

import pytest

Expand All @@ -15,7 +16,7 @@

class IStrMixin:

cls = NotImplemented
cls = Type[istr]

def test_ctor(self):
s = self.cls()
Expand Down
3 changes: 2 additions & 1 deletion tests/test_multidict.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ def test_getone(self, cls):
assert d.getone("key2", "default") == "default"

def test__iter__(
self, cls,
self,
cls,
):
d = cls([("key", "one"), ("key2", "two"), ("key", 3)])
assert list(d) == ["key", "key2", "key"]
Expand Down
9 changes: 6 additions & 3 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from typing import Type

import pytest

from multidict import MultiMapping
from multidict._compat import USE_CYTHON
from multidict._multidict_py import CIMultiDict as _CIMultiDict
from multidict._multidict_py import MultiDict as _MultiDict # noqa: E402
Expand All @@ -10,7 +13,7 @@


class VersionMixin:
cls = NotImplemented
cls: Type[MultiMapping[str]]

def getver(self, md):
raise NotImplementedError
Expand Down Expand Up @@ -178,15 +181,15 @@ def getver(self, md):

class TestPyMultiDict(VersionMixin):

cls = _MultiDict
cls = _MultiDict # type: ignore[assignment]

def getver(self, md):
return _getversion(md)


class TestPyCIMultiDict(VersionMixin):

cls = _CIMultiDict
cls = _CIMultiDict # type: ignore[assignment]

def getver(self, md):
return _getversion(md)

0 comments on commit d41493d

Please sign in to comment.