From 5cb9cd2681bf75d281a8d6b57d5da4047ed2da65 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Wed, 28 May 2025 17:00:31 +0200 Subject: [PATCH] Fix running the tests from other directories Running `pytest` (or calling the test file itseld) in the top directory now can run the tests or from within the `tests` directory. Previously, the working directory had to be exactly `tests/test_cvrf_full`. --- tests/test_cvrf_full/test_cvrf_full.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_cvrf_full/test_cvrf_full.py b/tests/test_cvrf_full/test_cvrf_full.py index 5afe0c3..26472aa 100644 --- a/tests/test_cvrf_full/test_cvrf_full.py +++ b/tests/test_cvrf_full/test_cvrf_full.py @@ -1,9 +1,10 @@ """File containing full CVRF test.""" import json from contextlib import suppress +from pathlib import Path -with open('./test_cvrf_full.json', encoding='utf-8') as f: +with open(Path(__file__).parent / 'test_cvrf_full.json', encoding='utf-8') as f: csaf = json.loads(f.read())