|
36 | 36 | from functools import lru_cache
|
37 | 37 | from pathlib import Path
|
38 | 38 | 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 |
40 | 40 |
|
41 | 41 | # 3rd party
|
42 | 42 | import pytest # nodep
|
@@ -302,7 +302,7 @@ def platform_boolean_factory(
|
302 | 302 | condition: bool,
|
303 | 303 | platform: str,
|
304 | 304 | versionadded: Optional[str] = None,
|
305 |
| - ) -> Tuple[Callable[[str], MarkDecorator], Callable[[str], MarkDecorator]]: |
| 305 | + ) -> Tuple[Callable[..., MarkDecorator], Callable[..., MarkDecorator]]: |
306 | 306 | """
|
307 | 307 | Factory function to return decorators such as :func:`~.not_pypy` and :func:`~.only_windows`.
|
308 | 308 |
|
@@ -357,12 +357,12 @@ def only_function(reason: str = default_reason.format("Only")) -> MarkDecorator:
|
357 | 357 | )
|
358 | 358 |
|
359 | 359 | 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") |
362 | 362 |
|
363 | 363 | 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") |
366 | 366 |
|
367 | 367 |
|
368 | 368 | @pytest.fixture()
|
|
0 commit comments