Skip to content

Fix StrTestCase on Windows#238

Closed
seproDev wants to merge 1 commit intofabiocaccamo:mainfrom
seproDev:str-test-windows
Closed

Fix StrTestCase on Windows#238
seproDev wants to merge 1 commit intofabiocaccamo:mainfrom
seproDev:str-test-windows

Conversation

@seproDev
Copy link
Copy Markdown
Contributor

@seproDev seproDev commented Jan 7, 2026


name: Pull request
about: Submit a pull request for this project
assignees: fabiocaccamo


Describe your changes
Fixes the test on Windows. Windows uses \ as the separator.

Related issue
?

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have added tests for the proposed changes.
  • I have run the tests and there are not errors.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.27%. Comparing base (4a2b086) to head (60efc74).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #238   +/-   ##
=======================================
  Coverage   99.27%   99.27%           
=======================================
  Files           8        8           
  Lines         971      971           
=======================================
  Hits          964      964           
  Misses          7        7           
Flag Coverage Δ
unittests 99.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fabiocaccamo fabiocaccamo moved this to Todo in Open Source Jan 8, 2026
@fabiocaccamo fabiocaccamo added bug Something isn't working and removed bug Something isn't working labels Jan 8, 2026
@fabiocaccamo
Copy link
Copy Markdown
Owner

fabiocaccamo commented Jan 8, 2026

@seproDev filepath is stored as string inside the Font instance, when calling __str__ the filepath string is used as it has been received in the constructor, so it will always work independently by the platform OS separator.

@fabiocaccamo fabiocaccamo added the invalid This doesn't seem right label Jan 8, 2026
@seproDev
Copy link
Copy Markdown
Contributor Author

seproDev commented Jan 8, 2026

@fabiocaccamo The test does currently fail under Windows. The issue is that fsutil returns the path using Windows style paths when calling _get_font_path

> import fsutil
> fsutil.join_path(__file__, f"data/arial.ttf")
'C:\\Users\\User\\AppData\\Roaming\\uv\\python\\cpython-3.13.5-windows-x86_64-none\\Lib\\_pyrepl\\data\\arial.ttf'

@fabiocaccamo
Copy link
Copy Markdown
Owner

@seproDev could you please add a failing unit test to this PR?

@seproDev
Copy link
Copy Markdown
Contributor Author

seproDev commented Jan 9, 2026

@fabiocaccamo StrTestCase as it is on main is currently failing on Windows.
You can not see this right now, for one due to curses missing none of the tests are execute (you do see the error for this in the log)
And due to pwsh continuing execution even after the test fails the last exit code is 0 and with that the pipeline is marked as "green"

@fabiocaccamo
Copy link
Copy Markdown
Owner

@seproDev I see it, thanks for explaining.

@fabiocaccamo
Copy link
Copy Markdown
Owner

@seproDev I fixed the tests in a simpler way, thank you very much for catching these issues.

@github-project-automation github-project-automation Bot moved this from Todo to Done in Open Source Jan 9, 2026
@seproDev seproDev deleted the str-test-windows branch January 9, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants