Skip to content

Commit 80e8870

Browse files
committed
Re-raise exception explicitly
Signed-off-by: Sergio Herrera <627709+seherv@users.noreply.github.com>
1 parent 163417f commit 80e8870

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

tests/integration/conftest.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,26 +202,17 @@ def resources_dir() -> Path:
202202
return RESOURCES_DIR
203203

204204

205-
@pytest.fixture(scope='session', autouse=True)
206-
def _binding_data_dir() -> Generator[None, None, None]:
207-
"""Provide a fresh ``.binding-data/`` for the localbinding component"""
208-
shutil.rmtree(BINDING_DATA_DIR, ignore_errors=True)
209-
BINDING_DATA_DIR.mkdir(parents=True, exist_ok=True)
210-
try:
211-
yield
212-
finally:
213-
shutil.rmtree(BINDING_DATA_DIR, ignore_errors=True)
214-
215-
216205
@pytest.fixture(scope='session', autouse=True)
217206
def crypto_keys() -> Generator[Path, None, None]:
218207
"""Generate temporary RSA + AES keys for ``cryptostore.yaml``.
219208
220209
Note: autouse is necessary because all sidecars load the entire resources/ folder, regardless
221210
of which components they actually test.
222211
"""
223-
write_test_keys(CRYPTO_KEYS_DIR)
224212
try:
213+
write_test_keys(CRYPTO_KEYS_DIR)
225214
yield CRYPTO_KEYS_DIR
215+
except Exception as exc:
216+
raise RuntimeError('Crypto keys failed to generate dynamically, cannot continue testing') from exc
226217
finally:
227218
remove_test_keys(CRYPTO_KEYS_DIR)

0 commit comments

Comments
 (0)