Skip to content

Bump pytest to >=7.4.0 #15611

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

Merged
merged 1 commit into from
Jul 12, 2023
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
7 changes: 5 additions & 2 deletions mypy/test/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,10 @@ def teardown(self) -> None:
def reportinfo(self) -> tuple[str, int, str]:
return self.file, self.line, self.name

def repr_failure(self, excinfo: Any, style: Any | None = None) -> str:
def repr_failure(
self, excinfo: pytest.ExceptionInfo[BaseException], style: Any | None = None
) -> str:
excrepr: object
if isinstance(excinfo.value, SystemExit):
# We assume that before doing exit() (which raises SystemExit) we've printed
# enough context about what happened so that a stack trace is not useful.
Expand All @@ -388,7 +391,7 @@ def repr_failure(self, excinfo: Any, style: Any | None = None) -> str:
elif isinstance(excinfo.value, pytest.fail.Exception) and not excinfo.value.pytrace:
excrepr = excinfo.exconly()
else:
self.parent._prunetraceback(excinfo)
excinfo.traceback = self.parent._traceback_filter(excinfo)
excrepr = excinfo.getrepr(style="short")

return f"data: {self.file}:{self.line}:\n{excrepr}"
Expand Down
4 changes: 1 addition & 3 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ lxml>=4.9.1; (python_version<'3.11' or sys_platform!='win32') and python_version
pre-commit
pre-commit-hooks==4.4.0
psutil>=4.0
# pytest 6.2.3 does not support Python 3.10
# TODO: fix use of removed private APIs so we can use the latest pytest
pytest>=6.2.4,<7.4.0
pytest>=7.4.0
pytest-xdist>=1.34.0
pytest-cov>=2.10.0
ruff==0.0.272 # must match version in .pre-commit-config.yaml
Expand Down