test: fix recordable mocks cache key

Summary:

Test Plan:
This commit is contained in:
Eric Huang 2025-03-07 13:44:12 -08:00
parent a1cdace093
commit 14afcff880

View file

@ -121,6 +121,9 @@ class RecordableMock:
# Replace temporary file paths created by tempfile.mkdtemp()
key = re.sub(r"/var/folders/[^,'\"\s]+", "<TEMP_FILE>", key)
# Replace /tmp/ paths which are also commonly used for temporary files
key = re.sub(r"/tmp/[^,'\"\s]+", "<TEMP_FILE>", key)
return key
def _save_cache(self):