Skip to content

Commit faa1cb9

Browse files
author
MrButtCode
committed
test: bypass webhook IP cache during tests to prevent state pollution
1 parent 89e3fd9 commit faa1cb9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

utility.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ def cache_has_expired() -> bool:
8989
:rtype: bool
9090
"""
9191
global cached_load_time
92+
from flask import current_app
93+
94+
# Always bypass cache during unit tests to prevent test pollution
95+
if current_app.config.get('TESTING'):
96+
return True
97+
9298
return cached_load_time + timedelta(hours=1) < datetime.now()
9399

94100

0 commit comments

Comments
 (0)