Skip to content

Conversation

@RonnyPfannschmidt
Copy link
Member

Consolidates scattered inline implementations into a single consistent helper.

This is a preparatory refactor for fixing conftest fixture scoping issues.

Consolidates scattered inline implementations into a single consistent helper.

Co-authored-by: Cursor AI <[email protected]>
Co-authored-by: Anthropic Claude Opus 4 <[email protected]>
Copilot AI review requested due to automatic review settings January 17, 2026 15:08
@RonnyPfannschmidt RonnyPfannschmidt added the skip news used on prs to opt out of the changelog requirement label Jan 17, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a helper function nodes.norm_sep to normalize path separators to forward slashes, consolidating previously scattered inline implementations. This refactoring improves code maintainability and prepares the codebase for upcoming conftest fixture scoping fixes.

Changes:

  • Added nodes.norm_sep() helper function with comprehensive test coverage
  • Replaced inline path separator normalization in terminal.py, nodes.py, and fixtures.py

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
testing/test_nodes.py Adds comprehensive test suite for the new norm_sep helper, covering various edge cases including forward slashes, backslashes, mixed separators, PathLike objects, empty strings, and Windows absolute paths
src/_pytest/nodes.py Introduces the norm_sep helper function and replaces two inline implementations with calls to this helper
src/_pytest/terminal.py Replaces inline path separator normalization with nodes.norm_sep call
src/_pytest/fixtures.py Replaces inline path separator normalization with nodes.norm_sep call, with improved conditional logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting.

@RonnyPfannschmidt RonnyPfannschmidt merged commit 3d27ab9 into pytest-dev:main Jan 17, 2026
39 checks passed
@RonnyPfannschmidt RonnyPfannschmidt deleted the add-nodes-norm-sep-helper branch January 17, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants