Skip to content

Commit 0a66eab

Browse files
committed
Make sure += follows accessing, rather than setting
1 parent 0e4d3d1 commit 0a66eab

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/trio/_tests/test_timeouts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ def test_invalid_access_unentered() -> None:
249249
match_str = "^Unentered relative cancel scope does not have an absolute deadline"
250250
with pytest.raises(RuntimeError, match=match_str):
251251
assert cs.deadline
252+
with pytest.raises(RuntimeError, match=match_str):
253+
cs.deadline += 5
252254

253255
# switch from relative to absolute
254256
cs.deadline = 7
@@ -260,6 +262,8 @@ def test_invalid_access_unentered() -> None:
260262
)
261263
with pytest.raises(RuntimeError, match=match_str):
262264
assert cs.relative_deadline
265+
with pytest.raises(RuntimeError, match=match_str):
266+
cs.relative_deadline += 5
263267

264268
cs.relative_deadline = 9
265269
assert cs.relative_deadline == 9

0 commit comments

Comments
 (0)