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
+1 -1
View File
@@ -106,7 +106,7 @@ def test_on_windows_the_lock_is_waited_for_while_another_writer_holds_it(tmp_pat
import errno
import sys
fake, calls = _fake_msvcrt([OSError(errno.EDEADLOCK, "held"), None])
fake, calls = _fake_msvcrt([OSError(errno.EDEADLK, "held"), None])
monkeypatch.setitem(sys.modules, "msvcrt", fake)
with open(tmp_path / "log.md.lock", "a+b") as handle, files._hold_windows(handle):