generated from personal-projects/leo-claude-mktplace
fix: isolate config tests from project environment
- Set PWD in monkeypatch to prevent _find_project_directory() from finding the real project - Explicitly delete GITEA_REPO from environment in all config tests - All 82 tests now pass (was 78/82)
This commit is contained in:
@@ -21,6 +21,8 @@ def test_load_system_config(tmp_path, monkeypatch):
|
|||||||
)
|
)
|
||||||
|
|
||||||
monkeypatch.setenv('HOME', str(tmp_path))
|
monkeypatch.setenv('HOME', str(tmp_path))
|
||||||
|
monkeypatch.setenv('PWD', str(tmp_path))
|
||||||
|
monkeypatch.delenv('GITEA_REPO', raising=False)
|
||||||
monkeypatch.chdir(tmp_path)
|
monkeypatch.chdir(tmp_path)
|
||||||
|
|
||||||
config = GiteaConfig()
|
config = GiteaConfig()
|
||||||
@@ -53,6 +55,8 @@ def test_project_config_override(tmp_path, monkeypatch):
|
|||||||
project_config.write_text("GITEA_REPO=test_repo\n")
|
project_config.write_text("GITEA_REPO=test_repo\n")
|
||||||
|
|
||||||
monkeypatch.setenv('HOME', str(tmp_path))
|
monkeypatch.setenv('HOME', str(tmp_path))
|
||||||
|
monkeypatch.setenv('PWD', str(project_dir))
|
||||||
|
monkeypatch.delenv('GITEA_REPO', raising=False)
|
||||||
monkeypatch.chdir(project_dir)
|
monkeypatch.chdir(project_dir)
|
||||||
|
|
||||||
config = GiteaConfig()
|
config = GiteaConfig()
|
||||||
@@ -114,6 +118,8 @@ def test_mode_detection_project(tmp_path, monkeypatch):
|
|||||||
)
|
)
|
||||||
|
|
||||||
monkeypatch.setenv('HOME', str(tmp_path))
|
monkeypatch.setenv('HOME', str(tmp_path))
|
||||||
|
monkeypatch.setenv('PWD', str(tmp_path))
|
||||||
|
monkeypatch.delenv('GITEA_REPO', raising=False)
|
||||||
monkeypatch.chdir(tmp_path)
|
monkeypatch.chdir(tmp_path)
|
||||||
|
|
||||||
config = GiteaConfig()
|
config = GiteaConfig()
|
||||||
@@ -141,6 +147,7 @@ def test_mode_detection_company(tmp_path, monkeypatch):
|
|||||||
)
|
)
|
||||||
|
|
||||||
monkeypatch.setenv('HOME', str(tmp_path))
|
monkeypatch.setenv('HOME', str(tmp_path))
|
||||||
|
monkeypatch.setenv('PWD', str(tmp_path))
|
||||||
monkeypatch.chdir(tmp_path)
|
monkeypatch.chdir(tmp_path)
|
||||||
|
|
||||||
config = GiteaConfig()
|
config = GiteaConfig()
|
||||||
|
|||||||
Reference in New Issue
Block a user