-
-
Notifications
You must be signed in to change notification settings - Fork 371
Allow CapacityLimiter to have zero total_tokens
#3321
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
Allow CapacityLimiter to have zero total_tokens
#3321
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3321 +/- ##
===============================================
Coverage 100.00000% 100.00000%
===============================================
Files 125 125
Lines 19497 19547 +50
Branches 1334 1336 +2
===============================================
+ Hits 19497 19547 +50
🚀 New features to boost your workflow:
|
A5rocks
left a comment
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 for the PR! Could you:
- add a newsfragment
- add a test for something like:
- create and use a capacity limiter with a limit of, say, 5
- set the limit to 0
- make sure it stops letting anything through
- set the limit up to, say, 5
- make sure it let everything through
- maybe also a test that a 0 limit capacity limiter doesn't let any tasks through? This is covered by the above but it's better to be extra sure.
If you can think of any case you're unsure works, that's what you would make a test case for!
|
@A5rocks of course, I'll let you know then 🤝 |
|
@AbduazizZiyodov did you run into any issues? I can maybe be a bit more detailed about something if so! |
|
@A5rocks I've added extra tests as you said (so far no "problema"), I'll be looking forward for your review. |
A5rocks
left a comment
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.
Minor nitpicks but this makes sense to me.
|
@A5rocks ready, I guess |
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 @AbduazizZiyodov! We really appreciate the time and care you put into this, and I'm looking forward to cleaning up a bit of affected code downstream.
|
Hey @AbduazizZiyodov, it looks like that was the first time we merged one of your PRs! Thanks so much! 🎉 🎂 If you want to keep contributing, we'd love to have you. So, I just sent you an invitation to join the python-trio organization on Github! If you accept, then here's what will happen:
If you want to read more, here's the relevant section in our contributing guide. Alternatively, you're free to decline or ignore the invitation. You'll still be able to contribute as much or as little as you like, and I won't hassle you about joining again. But if you ever change your mind, just let us know and we'll send another invitation. We'd love to have you, but more importantly we want you to do whatever's best for you. If you have any questions, well... I am just a humble Python script, so I probably can't help. But please do post a comment here, or in our chat, or on our forum, whatever's easiest, and someone will help you out! |
Closes #3243
Hi, I've only changed some existing tests & added one
assertstatement which checkstotal_tokensin case of zero. What kind of other tests should be included, if any needed ?