Compare commits

...

1 Commits

Author SHA1 Message Date
Neeraj Pradhan 22d56bf6e2 Invalidate cache when running extract tests 2026-01-26 17:24:18 -08:00
2 changed files with 12 additions and 6 deletions
+6 -2
View File
@@ -87,7 +87,11 @@ def test_agent(llama_extract, test_agent_name, test_schema_dict, request):
except Exception as e:
print(f"Warning: Failed to cleanup existing agent: {e}")
agent = create_agent_with_retry(llama_extract, name=name, data_schema=schema)
# Use config with cache invalidation to ensure fresh results in tests
config = ExtractConfig(invalidate_cache=True)
agent = create_agent_with_retry(
llama_extract, name=name, data_schema=schema, config=config
)
# Add agent to cleanup list via conftest helper
register_agent_for_cleanup(agent.id)
@@ -237,7 +241,7 @@ class TestStatelessExtraction:
@pytest.fixture
def test_config(self):
return ExtractConfig(extraction_mode=ExtractMode.FAST)
return ExtractConfig(extraction_mode=ExtractMode.FAST, invalidate_cache=True)
@pytest.fixture
def test_schema_dict(self):
+6 -4
View File
@@ -56,10 +56,12 @@ def get_test_cases():
input_files.append(file_path)
settings = [
ExtractConfig(extraction_mode=ExtractMode.FAST),
ExtractConfig(extraction_mode=ExtractMode.BALANCED),
ExtractConfig(extraction_mode=ExtractMode.MULTIMODAL),
ExtractConfig(extraction_mode=ExtractMode.PREMIUM),
ExtractConfig(extraction_mode=ExtractMode.FAST, invalidate_cache=True),
ExtractConfig(extraction_mode=ExtractMode.BALANCED, invalidate_cache=True),
ExtractConfig(
extraction_mode=ExtractMode.MULTIMODAL, invalidate_cache=True
),
ExtractConfig(extraction_mode=ExtractMode.PREMIUM, invalidate_cache=True),
]
for input_file in sorted(input_files):