diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-04 02:20:57 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-04 02:20:57 +0200 |
| commit | d11e571c5b6c24b586ef5b8fb2cfcf6a6bfa6d6d (patch) | |
| tree | fe3c4fbce3db02a8b84a15c413735622a51eefb0 /packages/meshbay-node/tests/conftest.py | |
| parent | 7a4b905ddb64bdc92b7f9acf2ccde9bd84d7a6f3 (diff) | |
| download | meshbay-d11e571c5b6c24b586ef5b8fb2cfcf6a6bfa6d6d.tar.gz | |
test(node): make the suite pass on Windows
- `.read_text()` on source files now `encoding="utf-8"` — cp1252 chokes on
the em dashes / box-drawing chars those files contain.
- test node.toml templates embed paths via `Path.as_posix()`: a raw Windows
path in a basic TOML string is a parse error (`\U`, `\a`, ... are escapes).
- new `test_platform.py` covers `meshbay_node.platform` by mocking
`sys.platform` / `os.environ` — runs on both OSes.
- `skipif(sys.platform == "win32")`, in `conftest.needs_subprocess` and
inline, for the documented gaps: ffmpeg/ffprobe via asyncio subprocess
(the win32 selector loop, forced for aiortc, cannot spawn one), the
systemd `reload`/`restart-daemon` delegation (Windows path is W3), the
keystore `st_mode == 600` assertion (NTFS ignores mode bits), and the
symlink-escape test (needs Developer Mode).
Windows: 781 passed, 25 skipped. No change on Linux.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/tests/conftest.py')
| -rw-r--r-- | packages/meshbay-node/tests/conftest.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/meshbay-node/tests/conftest.py b/packages/meshbay-node/tests/conftest.py index 03dfb42..20724aa 100644 --- a/packages/meshbay-node/tests/conftest.py +++ b/packages/meshbay-node/tests/conftest.py @@ -1,9 +1,28 @@ """Shared fixtures and helpers for node tests.""" +import sys from pathlib import Path +import pytest from meshbay_node.roots import RootSet +# ffmpeg / ffprobe run via asyncio.create_subprocess_exec, which needs the +# ProactorEventLoop — but the repo-root conftest forces the SelectorEventLoop +# on win32 so aiortc's ICE stack works there (see devel/windows-devel.md §5). +# The two are mutually exclusive on one Windows asyncio loop; until the media +# path gets a thread-based subprocess runner, these tests can't run on win32. +needs_subprocess = pytest.mark.skipif( + sys.platform == "win32", + reason="ffmpeg subprocess needs ProactorEventLoop; win32 conftest forces " + "SelectorEventLoop for aiortc", +) + +# Windows-only gaps still to close (see devel/windows-devel.md §5/§6). +win32_todo = pytest.mark.skipif( + sys.platform == "win32", + reason="Windows behaviour not implemented yet (W3 / platform specifics)", +) + def one_root(path: Path, *, name: str = "", kind: str = "generic") -> RootSet: """ |