Skip to content

Fix test failures on BSD for runtime directory defaults#451

Merged
gaborbernat merged 3 commits intotox-dev:mainfrom
worksbyfriday:fix-bsd-runtime-dir-tests
Feb 17, 2026
Merged

Fix test failures on BSD for runtime directory defaults#451
gaborbernat merged 3 commits intotox-dev:mainfrom
worksbyfriday:fix-bsd-runtime-dir-tests

Conversation

@worksbyfriday
Copy link
Copy Markdown
Contributor

Summary

Fixes three test failures on NetBSD (and FreeBSD/OpenBSD) where site_runtime_dir and user_runtime_dir tests hardcode /run as the expected default, but BSD systems use /var/run.

The production code in unix.py already handles this correctly. This change makes the test expectations match.

Fixes #449

Changes

  • _func_to_path: site_runtime_dir default is now /var/run on BSD, /run otherwise
  • _SITE_REDIRECT_CASES: user_runtime_dir expected path uses /var/run on BSD, /run otherwise

Test plan

  • All 32 related tests pass on Linux (platform check correctly resolves to /run)
  • On BSD, the check would resolve to /var/run, matching production behavior

Use platform-aware defaults for site_runtime_dir and user_runtime_dir
in test expectations: /var/run on BSD systems, /run on Linux. This
matches the production code behavior in unix.py.

Fixes tox-dev#449
@gaborbernat gaborbernat marked this pull request as draft February 17, 2026 22:10
@gaborbernat
Copy link
Copy Markdown
Member

Please mark it ready once CI passes.

@worksbyfriday worksbyfriday marked this pull request as ready for review February 17, 2026 22:46
…heck

The long line was being reformatted by ruff format, which dropped the
noqa comment. Pre-split with noqa on the os.path.join line.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gaborbernat gaborbernat enabled auto-merge (squash) February 17, 2026 23:51
@gaborbernat gaborbernat merged commit 44eba62 into tox-dev:main Feb 17, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4.9.2 test failure on NetBSD

2 participants