Skip to content

Conversation

@mr-c
Copy link
Contributor

@mr-c mr-c commented Mar 26, 2024

In Debian, we upgraded to pytest version 8.1.1+ for the next release.

pytest deprecated the name for the first positional argument to pytest.fail from msg to reason in Pytest 7.0 and removed msg in Pytest 8.0

https://docs.pytest.org/en/7.0.x/reference/reference.html#pytest-fail
https://docs.pytest.org/en/8.0.x/changelog.html#old-deprecations-are-now-errors

@github-actions

This comment has been minimized.

@mr-c
Copy link
Contributor Author

mr-c commented Mar 26, 2024

Ideally the minimum version of pytest would be increased to 8.1 and then the following additional change would be included, otherwise mypy will fail its self-checks with Pytest 8.1+

--- mypy.orig/mypy/test/data.py
+++ mypy/mypy/test/data.py
@@ -640,9 +640,7 @@
             # Non-None result means this obj is a test case.
             # The collect method of the returned DataSuiteCollector instance will be called later,
             # with self.obj being obj.
-            return DataSuiteCollector.from_parent(  # type: ignore[no-untyped-call]
-                parent=collector, name=name
-            )
+            return DataSuiteCollector.from_parent(parent=collector, name=name)
     return None

@AlexWaygood
Copy link
Member

AlexWaygood commented Mar 26, 2024

You could bump our pinned version of pytest by running pip-compile test-requirements.in --allow-unsafe --output-file=test-requirements.txt --strip-extras --upgrade-package pytest

Though if bumping pytest to 8.0+ requires changes to the self-test, then we might want to raise the lower bound specified in requirements.in, actually

@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just waiting for CI to finish

@JelleZijlstra JelleZijlstra merged commit bebd278 into python:master Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants