From 94b3003768ff0854a0a52ef55fd90be286c09d62 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 2 Oct 2024 06:55:01 +0300 Subject: Use pathlib to fetch the directory path for tests. * tests/fixtures/rdf.py: import pathlib. (rdf_setup): Use pathlib to get the dir name for the tests folder. Signed-off-by: Munyoki Kilyungi --- tests/fixtures/rdf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/fixtures/rdf.py b/tests/fixtures/rdf.py index 64d3107..98c4058 100644 --- a/tests/fixtures/rdf.py +++ b/tests/fixtures/rdf.py @@ -1,4 +1,5 @@ """Test fixtures to set up a test named graph for loading RDF data.""" +import pathlib import os import tempfile import subprocess @@ -24,7 +25,7 @@ SPARQL_CONF = { @pytest.fixture(scope="session") def rdf_setup(): """Upload RDF to a Virtuoso named graph""" - dir_path = os.path.dirname(__file__).split("fixtures")[0] + dir_path = pathlib.Path(__file__).parent.parent file_path = os.path.join( dir_path, "test_data/ttl-files/test-data.ttl", -- cgit v1.2.3