Skip to content

Commit b9084fa

Browse files
dlaxhynek
andauthored
Remove pytest.deprecated_call() in TestAssoc::test_unknown (#1249)
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 <[email protected]>
1 parent 3eab45c commit b9084fa

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ tests-no-zope = [
4141
"hypothesis",
4242
"pympler",
4343
# 4.3.0 dropped last use of `convert`
44-
# 8.0 broke something around warnings/exceptions
45-
"pytest>=4.3.0,<8.0",
44+
"pytest>=4.3.0",
4645
"pytest-xdist[psutil]",
4746
"attrs[tests-mypy]",
4847
]

tests/test_funcs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,7 @@ def test_unknown(self, C):
600600
AttrsAttributeNotFoundError.
601601
"""
602602
# No generated class will have a four letter attribute.
603-
with pytest.raises(
604-
AttrsAttributeNotFoundError
605-
) as e, pytest.deprecated_call():
603+
with pytest.raises(AttrsAttributeNotFoundError) as e:
606604
assoc(C(), aaaa=2)
607605

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

0 commit comments

Comments
 (0)