Skip to content

chore(deps): Update pytest version in upstream-requirements-py311.txt #776

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 3 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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: 3 additions & 4 deletions test/unit/test_compatability.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@


class TestWarnDeprecatedPython:
def test_happy_version(self):
def test_happy_version(self, recwarn):
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Sorry, I do not follow.
Why is this argument necessary?

Is this some magic incantation to tell pytest to record warnings?
And then assert that none were recorded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, these are called fixtures in pytest, see https://docs.pytest.org/en/8.2.x/how-to/capture-warnings.html#recwarn

This change was necessary because pytest.warns(None) is not allowed anymore.

with mock.patch.object(sys, "version_info") as v_info:
v_info.major = 3
v_info.minor = 8
with pytest.warns(None) as record:
_warn_deprecated_python()
assert len(record) == 0
_warn_deprecated_python()
assert len(recwarn) == 0

def test_below_warn(self):
with mock.patch.object(sys, "version_info") as v_info:
Expand Down
4 changes: 2 additions & 2 deletions test/upstream-requirements-py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ MarkupSafe==2.1.2
mock==4.0.3
moto==3.0.2
packaging==23.0
pluggy==1.0.0
pluggy==1.5.0
py==1.11.0
pycparser==2.21
pytest==7.2.1
pytest==8.2.0
pytest-cov==3.0.0
pytest-forked==1.6.0
pytest-mock==3.10.0
Expand Down
Loading