-
-
Notifications
You must be signed in to change notification settings - Fork 365
Define trio.Event.__bool__()
to reduce bugs
#3322
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3322 +/- ##
===============================================
Coverage 100.00000% 100.00000%
===============================================
Files 125 125
Lines 19251 19263 +12
Branches 1304 1304
===============================================
+ Hits 19251 19263 +12
🚀 New features to boost your workflow:
|
This is a strange request, but could we raise an error if some global variable is set? That way I could monkeypatch in the error behavior, even before we deal with every other trio deprecation. |
I think you can set a specific filterwarning configuration s.t. a specific warning will raise instead of warning. (in this case, I think just setting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
src/trio/_tests/test_sync.py
Outdated
@@ -23,6 +23,12 @@ async def test_Event() -> None: | |||
assert not e.is_set() | |||
assert e.statistics().tasks_waiting == 0 | |||
|
|||
with pytest.warns( | |||
DeprecationWarning, | |||
match=r"trio\.Event\.__bool__ is deprecated since Trio 0\.30\.1; use trio\.Event\.is_set instead \(https://github.com/python-trio/trio/issues/3238\)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably going to be 0.31.0 but I can update this whenever I make a release...
for more information, see https://pre-commit.ci
The unfortunate thing is this actually breaks |
Define it only |
Well, supposedly |
b1b5314
to
02c3794
Compare
In this pull request, we implement
trio.Event.__bool__()
to reduce bugs.Closes #3238