Skip to content

Commit e8c7a7f

Browse files
committed
Fix type hints.
1 parent d97312a commit e8c7a7f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

domdf_python_tools/testing.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from functools import lru_cache
3737
from pathlib import Path
3838
from textwrap import dedent
39-
from typing import Any, Callable, Iterator, List, Optional, Sequence, Tuple, Union
39+
from typing import Any, Callable, Iterator, List, Optional, Sequence, Tuple, Union, cast
4040

4141
# 3rd party
4242
import pytest # nodep
@@ -302,7 +302,7 @@ def platform_boolean_factory(
302302
condition: bool,
303303
platform: str,
304304
versionadded: Optional[str] = None,
305-
) -> Tuple[Callable[[str], MarkDecorator], Callable[[str], MarkDecorator]]:
305+
) -> Tuple[Callable[..., MarkDecorator], Callable[..., MarkDecorator]]:
306306
"""
307307
Factory function to return decorators such as :func:`~.not_pypy` and :func:`~.only_windows`.
308308
@@ -357,12 +357,12 @@ def only_function(reason: str = default_reason.format("Only")) -> MarkDecorator:
357357
)
358358

359359
not_docker, only_docker = platform_boolean_factory(condition=is_docker(), platform="Docker", versionadded="1.5.0")
360-
not_docker.__doc__ = not_docker.__doc__.replace("the current platform is", "running on")
361-
only_docker.__doc__ = only_docker.__doc__.replace("the current platform is", "running on")
360+
not_docker.__doc__ = cast(str, not_docker.__doc__).replace("the current platform is", "running on")
361+
only_docker.__doc__ = cast(str, only_docker.__doc__).replace("the current platform is", "running on")
362362

363363
not_pypy, only_pypy = platform_boolean_factory(condition=PYPY, platform="Docker", versionadded="0.9.0")
364-
not_pypy.__doc__ = not_pypy.__doc__.replace("current platform", "current Python implementation")
365-
only_pypy.__doc__ = only_pypy.__doc__.replace("current platform", "current Python implementation")
364+
not_pypy.__doc__ = cast(str, not_pypy.__doc__).replace("current platform", "current Python implementation")
365+
only_pypy.__doc__ = cast(str, only_pypy.__doc__).replace("current platform", "current Python implementation")
366366

367367

368368
@pytest.fixture()

tests/test_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
import platform
1313
import re
1414
import sys
15-
import types
1615
from collections import namedtuple
1716

1817
# 3rd party
1918
import pytest
20-
from deprecation import fail_if_not_removed
19+
from deprecation import fail_if_not_removed # type: ignore
2120
from pytest_regressions.file_regression import FileRegressionFixture
2221

2322
# this package

0 commit comments

Comments
 (0)