Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PytestPluginManager._is_in_confcutdir on Windows #12006

Closed

Commits on Feb 18, 2024

  1. Fix PytestPluginManager._is_in_confcutdir on Windows

    On Windows two paths might be in different drives, so if a path is not one of the parents of the confcutdir, it does not necessarily mean it is inside the confcutdir either.
    
    Use `Path.is_relative_to` instead which directly answers that question for us.
    
    The previous implementation could cause pytest to inspect all the parent paths of a path from one drive if pytest was invoked from another drive.
    
    Moved the implementation to a function because it would be too convoluted to test the `PytestPluginManager._is_in_confcutdir` method directly.
    nicoddemus committed Feb 18, 2024
    Configuration menu
    Copy the full SHA
    f829a1e View commit details
    Browse the repository at this point in the history