Skip to content

Commit

Permalink
Force cache build in automation (NVIDIA#907)
Browse files Browse the repository at this point in the history
If no existing cache is found for a test run as would be the case for
test automation, request a cache instance. This will cause the cache to
build once if any test is run by `pytest`.
  • Loading branch information
jmartin-tech authored Sep 9, 2024
2 parents ee22b5d + 9438858 commit 87addcb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import pytest
import os
from garak import _config
from garak import _config, _plugins

# force a local cache file to exist when this top level import is loaded
if not os.path.isfile(_plugins.PluginCache._user_plugin_cache_filename):
_plugins.PluginCache.instance()


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 87addcb

Please sign in to comment.