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

Document some minor subtleties in test_util.py #1749

Merged
merged 3 commits into from
Nov 29, 2023

Commits on Nov 29, 2023

  1. Mock out lchmod functions in _patch_for_wrapping_test?

    TestRmtree._patch_for_wrapping_test already mocked out the regular
    chmod functions in the os module and the Path class, to test what
    happens when changing permissions cannot fix an error. But there
    are also, on some systems and Python versions, lchmod versions of
    these functions. This patches those as well.
    
    I am not sure this should really be done. The problem is that
    calling such functions is fairly likely to raise an exception if
    it is not properly conditioned on a check for their actual
    usability, and mocking them out could obscure such a bug.
    EliahKagan committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    e309b35 View commit details
    Browse the repository at this point in the history
  2. Don't mock the lchmod functions, and explain why

    This undoes the mocking of lchmod functions from e309b35, and
    instead notes why they may be better left alone in the tests.
    
    This also rewords the existing comment to better explain the reason
    for the mocking that is being done.
    EliahKagan committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    a09e538 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2fabe71 View commit details
    Browse the repository at this point in the history