From 72878aa4fe32ef88416f356bc1f5167f79703ab3 Mon Sep 17 00:00:00 2001 From: Olivier Ramonat Date: Wed, 11 Dec 2024 10:17:22 +0100 Subject: [PATCH] Use a temp copy of the CVE cache to avoid altering repository files for it/e3-core#32 --- tests/tests_e3/cve/cve_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/tests_e3/cve/cve_test.py b/tests/tests_e3/cve/cve_test.py index 788e2a4e..4d00ccba 100644 --- a/tests/tests_e3/cve/cve_test.py +++ b/tests/tests_e3/cve/cve_test.py @@ -1,4 +1,5 @@ from e3.cve import NVD +from e3.fs import cp import os @@ -8,7 +9,8 @@ def test_nvd_cve_search(socket_disabled): from requests_cache import NEVER_EXPIRE from warnings import catch_warnings, simplefilter as warn_filter - cache_db = os.path.join(os.path.dirname(__file__), "cache") + cache_db = os.path.join(os.getcwd(), "cache") + cp(os.path.join(os.path.dirname(__file__), "cache"), cache_db, recursive=True) with catch_warnings(record=True) as w: # Used to always trigger python warnings if they appear