Skip to content

Commit fa09909

Browse files
committed
conftest.py: ignore user's home configuration when testing
Resolves: #201 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent 6c3107f commit fa09909

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import os
44
import shutil
55
import tempfile
6+
from unittest import mock
67

78
import pytest
89
from snakeoil.cli import arghparse
910

10-
from pkgdev.cli import Tool
11+
from pkgdev.cli import ConfigFileParser, Tool
1112
from pkgdev.scripts import pkgdev
1213

1314
pytest_plugins = ["pkgcore"]
@@ -21,7 +22,8 @@ def temporary_home():
2122
try:
2223
new_home = tempfile.mkdtemp()
2324
os.environ["HOME"] = new_home
24-
yield
25+
with mock.patch.object(ConfigFileParser, "default_configs", ()):
26+
yield
2527
finally:
2628
if old_home is None:
2729
del os.environ["HOME"]

0 commit comments

Comments
 (0)