mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
Fix expiration time assertion in key management tests
Adjust expiration time assertions to account for microsecond precision. This test usually fails by 500 ms max for me in February, hence the proposed change.
This commit is contained in:
parent
d07c87860d
commit
eed850ad9b
1 changed files with 6 additions and 0 deletions
|
|
@ -368,6 +368,12 @@ async def test_budget_reset_and_expires_at_first_of_month(monkeypatch):
|
|||
# Allow for some variance due to test execution time (subtract 1 second buffer for timing)
|
||||
expected_expires_min = now + timedelta(days=28, seconds=-1)
|
||||
expected_expires_max = now + timedelta(days=32)
|
||||
|
||||
# Remove ms precision as it can cause issues with the assertion due to small differences in execution time
|
||||
expires = expires.replace(microsecond=0)
|
||||
expected_expires_min = expected_expires_min.replace(microsecond=0)
|
||||
expected_expires_max = expected_expires_max.replace(microsecond=0)
|
||||
|
||||
assert (
|
||||
expected_expires_min <= expires <= expected_expires_max
|
||||
), f"Expected expires to be approximately 1 month from now, got {expires}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue