Skip to content

Conversation

AbduazizZiyodov
Copy link

Closes #3243

Hi, I've only changed some existing tests & added one assert statement which checks total_tokens in case of zero. What kind of other tests should be included, if any needed ?

Copy link

codecov bot commented Aug 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00000%. Comparing base (77dd921) to head (2f4c529).

Additional details and impacted files
@@               Coverage Diff               @@
##                 main        #3321   +/-   ##
===============================================
  Coverage   100.00000%   100.00000%           
===============================================
  Files             125          125           
  Lines           19251        19252    +1     
  Branches         1304         1304           
===============================================
+ Hits            19251        19252    +1     
Files with missing lines Coverage Δ
src/trio/_sync.py 100.00000% <100.00000%> (ø)
src/trio/_tests/test_sync.py 100.00000% <100.00000%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@A5rocks A5rocks left a 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!

@AbduazizZiyodov
Copy link
Author

@A5rocks of course, I'll let you know then 🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow CapacityLimiter to have total_tokens=0
2 participants