Skip to content
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

py36+: update the target version of black to py36 #7846

Merged
merged 1 commit into from Oct 3, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -102,4 +102,4 @@ template = "changelog/_template.rst"
showcontent = true

[tool.black]
target-version = ['py35']
target-version = ['py36']
2 changes: 1 addition & 1 deletion src/_pytest/_io/saferepr.py
Expand Up @@ -122,7 +122,7 @@ def _pformat_dispatch(
width: int = 80,
depth: Optional[int] = None,
*,
compact: bool = False
compact: bool = False,
) -> str:
return AlwaysDispatchingPrettyPrinter(
indent=indent, width=width, depth=depth, compact=compact
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/_io/terminalwriter.py
Expand Up @@ -109,7 +109,7 @@ def sep(
sepchar: str,
title: Optional[str] = None,
fullwidth: Optional[int] = None,
**markup: bool
**markup: bool,
) -> None:
if fullwidth is None:
fullwidth = self.fullwidth
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/compat.py
Expand Up @@ -116,7 +116,7 @@ def getfuncargnames(
*,
name: str = "",
is_method: bool = False,
cls: Optional[type] = None
cls: Optional[type] = None,
) -> Tuple[str, ...]:
"""Return the names of a function's mandatory arguments.

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/config/__init__.py
Expand Up @@ -866,7 +866,7 @@ def __init__(
self,
pluginmanager: PytestPluginManager,
*,
invocation_params: Optional[InvocationParams] = None
invocation_params: Optional[InvocationParams] = None,
) -> None:
from .argparsing import Parser, FILE_OR_DIR

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/doctest.py
Expand Up @@ -260,7 +260,7 @@ def from_parent( # type: ignore
*,
name: str,
runner: "doctest.DocTestRunner",
dtest: "doctest.DocTest"
dtest: "doctest.DocTest",
):
# incompatible signature due to to imposed limits on sublcass
"""The public named constructor."""
Expand Down
8 changes: 4 additions & 4 deletions src/_pytest/fixtures.py
Expand Up @@ -1220,7 +1220,7 @@ def fixture(
Callable[[Any], Optional[object]],
]
] = ...,
name: Optional[str] = ...
name: Optional[str] = ...,
) -> _FixtureFunction:
...

Expand All @@ -1238,7 +1238,7 @@ def fixture( # noqa: F811
Callable[[Any], Optional[object]],
]
] = ...,
name: Optional[str] = None
name: Optional[str] = None,
) -> FixtureFunctionMarker:
...

Expand All @@ -1255,7 +1255,7 @@ def fixture( # noqa: F811
Callable[[Any], Optional[object]],
]
] = None,
name: Optional[str] = None
name: Optional[str] = None,
) -> Union[FixtureFunctionMarker, _FixtureFunction]:
"""Decorator to mark a fixture factory function.

Expand Down Expand Up @@ -1325,7 +1325,7 @@ def yield_fixture(
params=None,
autouse=False,
ids=None,
name=None
name=None,
):
"""(Return a) decorator to mark a yield-fixture factory function.

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/mark/__init__.py
Expand Up @@ -47,7 +47,7 @@
def param(
*values: object,
marks: Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]] = (),
id: Optional[str] = None
id: Optional[str] = None,
) -> ParameterSet:
"""Specify a parameter in `pytest.mark.parametrize`_ calls or
:ref:`parametrized fixtures <fixture-parametrize-marks>`.
Expand Down
10 changes: 5 additions & 5 deletions src/_pytest/mark/structures.py
Expand Up @@ -89,7 +89,7 @@ def param(
cls,
*values: object,
marks: Union["MarkDecorator", Collection[Union["MarkDecorator", "Mark"]]] = (),
id: Optional[str] = None
id: Optional[str] = None,
) -> "ParameterSet":
if isinstance(marks, MarkDecorator):
marks = (marks,)
Expand Down Expand Up @@ -138,7 +138,7 @@ def _parse_parametrize_args(
argnames: Union[str, List[str], Tuple[str, ...]],
argvalues: Iterable[Union["ParameterSet", Sequence[object], object]],
*args,
**kwargs
**kwargs,
) -> Tuple[Union[List[str], Tuple[str, ...]], bool]:
if not isinstance(argnames, (tuple, list)):
argnames = [x.strip() for x in argnames.split(",") if x.strip()]
Expand Down Expand Up @@ -400,7 +400,7 @@ def __call__( # type: ignore[override]
self,
condition: Union[str, bool] = ...,
*conditions: Union[str, bool],
reason: str = ...
reason: str = ...,
) -> MarkDecorator:
...

Expand All @@ -417,7 +417,7 @@ def __call__( # noqa: F811
reason: str = ...,
run: bool = ...,
raises: Union[Type[BaseException], Tuple[Type[BaseException], ...]] = ...,
strict: bool = ...
strict: bool = ...,
) -> MarkDecorator:
...

Expand All @@ -434,7 +434,7 @@ def __call__( # type: ignore[override]
Callable[[Any], Optional[object]],
]
] = ...,
scope: Optional[_Scope] = ...
scope: Optional[_Scope] = ...,
) -> MarkDecorator:
...

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/pathlib.py
Expand Up @@ -441,7 +441,7 @@ class ImportPathMismatchError(ImportError):
def import_path(
p: Union[str, py.path.local, Path],
*,
mode: Union[str, ImportMode] = ImportMode.prepend
mode: Union[str, ImportMode] = ImportMode.prepend,
) -> ModuleType:
"""Import and return a module from the given path, which can be a file (a module) or
a directory (a package).
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/pytester.py
Expand Up @@ -1211,7 +1211,7 @@ def popen(
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=CLOSE_STDIN,
**kw
**kw,
):
"""Invoke subprocess.Popen.

Expand Down Expand Up @@ -1530,7 +1530,7 @@ def _match_lines(
match_func: Callable[[str, str], bool],
match_nickname: str,
*,
consecutive: bool = False
consecutive: bool = False,
) -> None:
"""Underlying implementation of ``fnmatch_lines`` and ``re_match_lines``.

Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/python.py
Expand Up @@ -975,7 +975,7 @@ def parametrize(
] = None,
scope: "Optional[_Scope]" = None,
*,
_param_mark: Optional[Mark] = None
_param_mark: Optional[Mark] = None,
) -> None:
"""Add new invocations to the underlying test function using the list
of argvalues for the given argnames. Parametrization is performed
Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/python_api.py
Expand Up @@ -559,7 +559,7 @@ def _is_numpy_array(obj: object) -> bool:
def raises(
expected_exception: Union[Type[_E], Tuple[Type[_E], ...]],
*,
match: Optional[Union[str, Pattern[str]]] = ...
match: Optional[Union[str, Pattern[str]]] = ...,
) -> "RaisesContext[_E]":
...

Expand All @@ -569,7 +569,7 @@ def raises( # noqa: F811
expected_exception: Union[Type[_E], Tuple[Type[_E], ...]],
func: Callable[..., Any],
*args: Any,
**kwargs: Any
**kwargs: Any,
) -> _pytest._code.ExceptionInfo[_E]:
...

Expand Down
6 changes: 3 additions & 3 deletions src/_pytest/recwarn.py
Expand Up @@ -85,7 +85,7 @@ def deprecated_call( # noqa: F811
def warns(
expected_warning: Optional[Union[Type[Warning], Tuple[Type[Warning], ...]]],
*,
match: Optional[Union[str, Pattern[str]]] = ...
match: Optional[Union[str, Pattern[str]]] = ...,
) -> "WarningsChecker":
...

Expand All @@ -95,7 +95,7 @@ def warns( # noqa: F811
expected_warning: Optional[Union[Type[Warning], Tuple[Type[Warning], ...]]],
func: Callable[..., T],
*args: Any,
**kwargs: Any
**kwargs: Any,
) -> T:
...

Expand All @@ -104,7 +104,7 @@ def warns( # noqa: F811
expected_warning: Optional[Union[Type[Warning], Tuple[Type[Warning], ...]]],
*args: Any,
match: Optional[Union[str, Pattern[str]]] = None,
**kwargs: Any
**kwargs: Any,
) -> Union["WarningsChecker", Any]:
r"""Assert that code raises a particular class of warning.

Expand Down
4 changes: 2 additions & 2 deletions src/_pytest/reports.py
Expand Up @@ -246,7 +246,7 @@ def __init__(
sections: Iterable[Tuple[str, str]] = (),
duration: float = 0,
user_properties: Optional[Iterable[Tuple[str, object]]] = None,
**extra
**extra,
) -> None:
#: Normalized collection nodeid.
self.nodeid = nodeid
Expand Down Expand Up @@ -348,7 +348,7 @@ def __init__(
longrepr,
result: Optional[List[Union[Item, Collector]]],
sections: Iterable[Tuple[str, str]] = (),
**extra
**extra,
) -> None:
#: Normalized collection nodeid.
self.nodeid = nodeid
Expand Down
2 changes: 1 addition & 1 deletion src/_pytest/terminal.py
Expand Up @@ -450,7 +450,7 @@ def write_sep(
sep: str,
title: Optional[str] = None,
fullwidth: Optional[int] = None,
**markup: bool
**markup: bool,
) -> None:
self.ensure_newline()
self._tw.sep(sep, title, fullwidth, **markup)
Expand Down