|
20 | 20 | from pathlib import PosixPath |
21 | 21 |
|
22 | 22 | import pytest |
23 | | -from pytest_mock import MockFixture |
24 | 23 |
|
25 | | -from pyiceberg.catalog import Catalog, _get_env_config, load_catalog |
| 24 | +from pyiceberg.catalog import Catalog, load_catalog |
26 | 25 | from pyiceberg.catalog.memory import InMemoryCatalog |
27 | 26 | from pyiceberg.io import WAREHOUSE |
28 | 27 | from pyiceberg.schema import Schema |
29 | 28 | from pyiceberg.types import NestedField, StringType |
30 | | -from pyiceberg.utils.config import Config |
31 | 29 |
|
32 | 30 |
|
33 | 31 | @pytest.fixture |
@@ -65,20 +63,6 @@ def test_load_catalog_has_type_and_impl() -> None: |
65 | 63 | ) |
66 | 64 |
|
67 | 65 |
|
68 | | -def test_get_env_config_is_lazy_and_cached(mocker: MockFixture) -> None: |
69 | | - original_config = _get_env_config() |
70 | | - _get_env_config.cache_clear() |
71 | | - config = Config({"catalog": {"test": {"type": "in-memory"}}}) |
72 | | - load_mock = mocker.patch("pyiceberg.catalog.Config.load", return_value=config) |
73 | | - assert _get_env_config() is config |
74 | | - assert _get_env_config() is config |
75 | | - load_mock.assert_called_once() |
76 | | - |
77 | | - _get_env_config.cache_clear() |
78 | | - mocker.patch("pyiceberg.catalog.Config.load", return_value=original_config) |
79 | | - assert _get_env_config() is original_config |
80 | | - |
81 | | - |
82 | 66 | def test_catalog_repr(catalog: InMemoryCatalog) -> None: |
83 | 67 | s = repr(catalog) |
84 | 68 | assert s == "test.in_memory.catalog (<class 'pyiceberg.catalog.memory.InMemoryCatalog'>)" |
|
0 commit comments