File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from pathlib import Path
2+ import tempfile
23from unittest .mock import patch
34
45import pytest
1819 'test_registry_as_dict' ,
1920]
2021
21- # filepath: ontograph/test_client.py
22-
2322
2423@pytest .fixture
2524def 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
5757def test_load_registry (client , mock_adapter ):
You can’t perform that action at this time.
0 commit comments