Skip to content

Commit 304bfab

Browse files
chores: replace the temporary directory with the import tempfile built-in library
1 parent a06c7c4 commit 304bfab

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/test_client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pathlib import Path
2+
import tempfile
23
from unittest.mock import patch
34

45
import pytest
@@ -18,8 +19,6 @@
1819
'test_registry_as_dict',
1920
]
2021

21-
# filepath: ontograph/test_client.py
22-
2322

2423
@pytest.fixture
2524
def mock_adapter():
@@ -43,15 +42,16 @@ def mock_adapter():
4342

4443

4544
@pytest.fixture
46-
def temp_cache_dir(tmp_path: Path) -> Path:
47-
"""Provide temporary directory for testing."""
48-
return tmp_path
45+
def temp_cache_dir():
46+
"""Fixture to provide a temporary directory."""
47+
with tempfile.TemporaryDirectory() as temp_dir:
48+
yield Path(temp_dir)
4949

5050

5151
@pytest.fixture
52-
def client(mock_adapter):
52+
def client(mock_adapter, temp_cache_dir):
5353
"""Fixture to create an OntoRegistryClient instance."""
54-
return OntoRegistryClient(cache_dir=Path(temp_cache_dir))
54+
return OntoRegistryClient(cache_dir=temp_cache_dir)
5555

5656

5757
def test_load_registry(client, mock_adapter):

0 commit comments

Comments
 (0)