Skip to content

Commit 68b329d

Browse files
authored
Merge pull request #8764 from pytest-dev/pre-commit-ci-update-config
2 parents ced125a + ab3cd64 commit 68b329d

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 21.5b2
3+
rev: 21.6b0
44
hooks:
55
- id: black
66
args: [--safe, --quiet]
@@ -34,7 +34,7 @@ repos:
3434
- id: reorder-python-imports
3535
args: ['--application-directories=.:src', --py36-plus]
3636
- repo: https://github.com/asottile/pyupgrade
37-
rev: v2.19.1
37+
rev: v2.19.4
3838
hooks:
3939
- id: pyupgrade
4040
args: [--py36-plus]
@@ -44,11 +44,11 @@ repos:
4444
- id: setup-cfg-fmt
4545
args: [--max-py-version=3.10]
4646
- repo: https://github.com/pre-commit/pygrep-hooks
47-
rev: v1.8.0
47+
rev: v1.9.0
4848
hooks:
4949
- id: python-use-type-annotations
5050
- repo: https://github.com/pre-commit/mirrors-mypy
51-
rev: v0.812
51+
rev: v0.902
5252
hooks:
5353
- id: mypy
5454
files: ^(src/|testing/)
@@ -58,6 +58,8 @@ repos:
5858
- py>=1.8.2
5959
- attrs>=19.2.0
6060
- packaging
61+
- types-toml
62+
- types-pkg_resources
6163
- repo: local
6264
hooks:
6365
- id: rst

src/_pytest/_code/code.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
if TYPE_CHECKING:
5050
from typing_extensions import Literal
51+
from typing_extensions import SupportsIndex
5152
from weakref import ReferenceType
5253

5354
_TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"]
@@ -371,14 +372,16 @@ def cut(
371372
return self
372373

373374
@overload
374-
def __getitem__(self, key: int) -> TracebackEntry:
375+
def __getitem__(self, key: "SupportsIndex") -> TracebackEntry:
375376
...
376377

377378
@overload
378379
def __getitem__(self, key: slice) -> "Traceback":
379380
...
380381

381-
def __getitem__(self, key: Union[int, slice]) -> Union[TracebackEntry, "Traceback"]:
382+
def __getitem__(
383+
self, key: Union["SupportsIndex", slice]
384+
) -> Union[TracebackEntry, "Traceback"]:
382385
if isinstance(key, slice):
383386
return self.__class__(super().__getitem__(key))
384387
else:

src/_pytest/logging.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ def set_log_path(self, fname: str) -> None:
626626
finally:
627627
self.log_file_handler.release()
628628
if old_stream:
629-
old_stream.close()
629+
# https://github.com/python/typeshed/pull/5663
630+
old_stream.close() # type:ignore[attr-defined]
630631

631632
def _log_cli_enabled(self):
632633
"""Return whether live logging is enabled."""

0 commit comments

Comments
 (0)