mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-12-02 14:06:32 +02:00
test: stop reloading modules, so the suite passes in any order
- default_config.build_default_config gives the defaults with the environment as it is now; the overlay tests call it instead of reloading the module, whose reloaded DEFAULT_CONFIG leaked their settings into later tests - the Ollama and API-key tests import the modules they check, which read the environment when called; two tests that only read os.environ are dropped
This commit is contained in:
@@ -67,12 +67,10 @@ def test_case_insensitive_lookup():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def prompts(monkeypatch):
|
||||
"""Import cli.prompts with a fresh environment so module-level state is consistent."""
|
||||
import importlib
|
||||
|
||||
def prompts():
|
||||
"""cli.prompts, which reads the environment when it is called."""
|
||||
import cli.prompts as prompts_module
|
||||
return importlib.reload(prompts_module)
|
||||
return prompts_module
|
||||
|
||||
|
||||
def test_ensure_api_key_returns_existing(monkeypatch, prompts):
|
||||
|
||||
Reference in New Issue
Block a user