Skip to content

Commit

Permalink
Merge pull request #1498 from pquentin/remove-event-clear
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin authored May 6, 2020
2 parents 0ca6b1d + a6de20a commit 27aaf69
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
1 change: 1 addition & 0 deletions newsfragments/1498.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove ``clear`` method on `trio.Event`: it was deprecated in 0.12.0.
8 changes: 0 additions & 8 deletions trio/_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ def set(self):
self._flag = True
self._lot.unpark_all()

@deprecated(
"0.12.0",
issue=637,
instead="multiple Event objects or other synchronization primitives"
)
def clear(self):
self._flag = False

async def wait(self):
"""Block until the internal flag value becomes True.
Expand Down
10 changes: 0 additions & 10 deletions trio/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ async def child():
assert record == ["sleeping", "sleeping", "woken", "woken"]


# When we remove clear() then this test can be removed too
def test_Event_clear(recwarn):
e = Event()
assert not e.is_set()
e.set()
assert e.is_set()
e.clear()
assert not e.is_set()


async def test_CapacityLimiter():
with pytest.raises(TypeError):
CapacityLimiter(1.0)
Expand Down

0 comments on commit 27aaf69

Please sign in to comment.