The encoder path test asserts a POSIX rendering of `Path`, so it fails on Windows

Open
#431 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@Luckyou-d is already working on this.

Since Nov 24, 2026.

  • #432 by @Luckyou-d — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing

Research direction

The failing assertion is in tests/model_runtime/test_encoders.py, in TestEncoders::test_jsonable_encoder_path. The encoder maps Path to str at src/graphon/model_runtime/utils/encoders.py line 86, so leave that code alone. Change the expected value to str(Path(...)) and confirm the test passes on both POSIX and Windows. Work is already under way in open PR #432, so check that before starting.

Written by the indexing model from the issue text.

Description

Problem

tests/model_runtime/test_encoders.py::TestEncoders::test_jsonable_encoder_path asserts a POSIX rendering of a Path, but the encoder maps Path to str, which carries the platform's separator:

Windows: assert '\example\test' == '/example/test'
src/graphon/model_runtime/utils/encoders.py:86   Path: str,   # -> str(path)

So the case is red on Windows and green on POSIX, which is the only platform CI runs.

Expected

The unit test states what the encoder does on the platform it runs on, so pytest tests/model_runtime/test_encoders.py is green on Windows too.

Fix

Compare against str(Path(...)) instead of a literal POSIX string. PR to follow.

Note this is deliberately a test-side change: making the encoder emit as_posix() for every Path would change what a Windows user's paths look like in the JSON the API returns, which is a product decision rather than a test fix - happy to do it in a separate change if that stability is wanted.

Dominant language
Python
Stars
90
Forks
47
Avg merge
3d 23h
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from langgenius/graphon

All issues in langgenius/graphon

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.