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
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test = ["testscenarios", "testresources"]
twisted = ["Twisted", "fixtures"]
dev = [
"ruff==0.15.8",
"mypy>=1.0.0",
"mypy>=1.20.0",
"typing-extensions;python_version<'3.11'",
]

Expand All @@ -63,7 +63,9 @@ python_version = "3.10"
show_column_numbers = true
show_error_context = true
strict = true
warn_unused_ignores = true
# remove this when 1.20.1 is released
# https://github.com/python/mypy/issues/21137
warn_unused_configs = false
# FIXME(stephenfin): We should remove this
implicit_reexport = true
exclude = 'doc'
Expand Down
16 changes: 8 additions & 8 deletions testtools/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,18 +577,18 @@ def assertIsInstance( # type: ignore[override]
def assertRaises(
self,
expected_exception: type[_E],
callable: Callable[_P, _R],
*args: _P.args,
**kwargs: _P.kwargs,
callable: Callable[..., Any],
*args: Any,
**kwargs: Any,
) -> _E: ...

@overload
def assertRaises(
self,
expected_exception: tuple[type[BaseException], ...],
callable: Callable[_P, _R],
*args: _P.args,
**kwargs: _P.kwargs,
callable: Callable[..., Any],
*args: Any,
**kwargs: Any,
) -> BaseException: ...

@overload
Expand Down Expand Up @@ -928,7 +928,7 @@ def _validate_setup_called(result: object) -> object:
)
return result

ret.addBoth(_validate_setup_called)
ret.addBoth(_validate_setup_called) # type: ignore[attr-defined]
else:
# Synchronous: validate immediately
if not self.__setup_called:
Expand Down Expand Up @@ -964,7 +964,7 @@ def _validate_teardown_called(result: object) -> object:
)
return result

ret.addBoth(_validate_teardown_called)
ret.addBoth(_validate_teardown_called) # type: ignore[attr-defined]
else:
# Synchronous: validate immediately
if not self.__teardown_called:
Expand Down
2 changes: 1 addition & 1 deletion testtools/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def iterate_tests(
for test in test_suite_or_case:
yield from iterate_tests(test)
else:
yield test_suite_or_case # type: ignore[misc]
yield test_suite_or_case


class ConcurrentTestSuite(unittest.TestSuite):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ commands =

[testenv:mypy]
deps =
mypy
mypy>=1.20.0
commands =
mypy --cache-dir="{envdir}/mypy_cache" {posargs:testtools}