Skip to content

Commit cbcf09f

Browse files
authored
ignore local config when running tests (#872)
1 parent feb53db commit cbcf09f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from __future__ import annotations
22

33
import typing as t
4+
from pathlib import Path
45
from shutil import rmtree
6+
from tempfile import TemporaryDirectory
7+
from unittest import mock
58

69
import duckdb
710
import pytest
@@ -19,6 +22,15 @@
1922
pytest_plugins = ["tests.common_fixtures"]
2023

2124

25+
# Ignore all local config files
26+
@pytest.fixture(scope="session", autouse=True)
27+
def ignore_local_config_files():
28+
mock_home = mock.Mock()
29+
mock_home.return_value = Path(TemporaryDirectory().name)
30+
with mock.patch("pathlib.Path.home", mock_home):
31+
yield
32+
33+
2234
@pytest.fixture
2335
def context(tmpdir) -> Context:
2436
return Context(paths=str(tmpdir))

0 commit comments

Comments
 (0)