test: fix tests that failed on Windows and macOS (#1506, #1485, #1541)

- the module-help subprocess is read as UTF-8 under a cp1252 locale
- the yfinance cache check names the suite's directory, which may sit under the home on Windows
- POSIX file modes and shell upgrade commands are checked only off Windows
- file locking names errno.EDEADLK, which macOS also defines
This commit is contained in:
Yijia-Xiao
2026-10-27 08:01:08 +00:00
parent ec4e2c8e5a
commit d46c052278
6 changed files with 20 additions and 8 deletions
+2
View File
@@ -242,6 +242,7 @@ def _dist(direct=None, installer="pip"):
@pytest.mark.unit
@pytest.mark.skipif(os.name == "nt", reason="the upgrade commands are POSIX shell")
def test_the_upgrade_command_follows_the_install(tmp_path, monkeypatch):
clone = tmp_path / "TradingAgents"
(clone / ".git").mkdir(parents=True)
@@ -314,6 +315,7 @@ def test_remote_text_cannot_carry_c1_or_direction_controls():
@pytest.mark.unit
@pytest.mark.skipif(os.name == "nt", reason="the upgrade commands are POSIX shell")
def test_a_uv_git_install_is_upgraded_with_uv(monkeypatch):
monkeypatch.delenv("TRADINGAGENTS_IN_DOCKER", raising=False)
monkeypatch.setattr(updates.sys, "executable", "/venv/bin/python")