File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 4040 TYPE_CHECKING ,
4141 Any ,
4242)
43+ from unittest import mock
4344
4445import boto3
4546import pytest
@@ -112,6 +113,20 @@ def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
112113 item .add_marker ("unmarked" )
113114
114115
116+ @pytest .fixture (autouse = True , scope = "session" )
117+ def _isolate_pyiceberg_config () -> None :
118+ """Make test runs ignore your local PyIceberg config.
119+
120+ Without this, tests will attempt to resolve a local ~/.pyiceberg.yaml while running pytest.
121+ This replaces the global catalog config once at session start with an env-only config.
122+ """
123+ import pyiceberg .catalog as _catalog_module
124+ from pyiceberg .utils .config import Config
125+
126+ with mock .patch .object (Config , "_from_configuration_files" , return_value = None ):
127+ _catalog_module ._ENV_CONFIG = Config ()
128+
129+
115130def pytest_addoption (parser : pytest .Parser ) -> None :
116131 # S3 options
117132 parser .addoption (
You can’t perform that action at this time.
0 commit comments