Skip to content

Commit

Permalink
Remove pytest.deprecated_call() in TestAssoc::test_unknown (#1249)
Browse files Browse the repository at this point in the history
assoc() no longer raises a deprecation warning since commit
22ae847 but the 'with
pytest.deprecated_call():' in that test was not removed then (in
contrast with other test cases).

Maybe this got unnoticed due to a pytest bug?
In any case, using pytest 8+ (and keeping deprecated_call()) shows that
no warning is raised and the test fails.

Removing the upper bound on pytest in dev dependencies as tests now
pass with pytest 8.0.

Fix #1233.

Co-authored-by: Hynek Schlawack <hs@ox.cx>
  • Loading branch information
dlax and hynek committed Mar 2, 2024
1 parent 3eab45c commit b9084fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ tests-no-zope = [
"hypothesis",
"pympler",
# 4.3.0 dropped last use of `convert`
# 8.0 broke something around warnings/exceptions
"pytest>=4.3.0,<8.0",
"pytest>=4.3.0",
"pytest-xdist[psutil]",
"attrs[tests-mypy]",
]
Expand Down
4 changes: 1 addition & 3 deletions tests/test_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,7 @@ def test_unknown(self, C):
AttrsAttributeNotFoundError.
"""
# No generated class will have a four letter attribute.
with pytest.raises(
AttrsAttributeNotFoundError
) as e, pytest.deprecated_call():
with pytest.raises(AttrsAttributeNotFoundError) as e:
assoc(C(), aaaa=2)

assert (f"aaaa is not an attrs attribute on {C!r}.",) == e.value.args
Expand Down

0 comments on commit b9084fa

Please sign in to comment.