-
Notifications
You must be signed in to change notification settings - Fork 3k
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 directories not cleaned up after test #12773
Fix directories not cleaned up after test #12773
Conversation
6279494
to
cb9cbc3
Compare
Failures are not related (caused by a CPython change). |
Thanks, I was just looking into this (I see you've raised a PR to address it) |
cb9cbc3
to
3158114
Compare
The `test_rmtree_errorhandler_reraises_error` test creates a directory that the user is unable to read under pytest's `tmpdir`. Once the test session end pytest will fail to clean this up due to permissions error and emit a warning like: /home/user/src/pip/.nox/test-3-12/lib/python3.12/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-user/garbage-23e907a9-3e54-40bd-89e4-d70150b10f61/test_rmtree_errorhandler_rerai0 <class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0' warnings.warn( This restores behaviour from b5c1c76, that commit mentions fixing 'failing tests' though I'm not sure which failures that addresses and if they were related to restoring the file permissions. Also make consistent use of `pathlib.Path` methods rather than mixing them with `os.` methods
3158114
to
8cdf797
Compare
latest change is just me rebasing on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'm glad to see these warnings disappear. Thanks :)
The
test_rmtree_errorhandler_reraises_error
test creates a directorythat the user is unable to read under pytest's
tmpdir
. Once the testsession end pytest will fail to clean this up due to permissions error
and emit a warning like:
This restores behaviour from b5c1c76,
that commit mentions fixing 'failing tests' though I'm not sure which
failures that addresses and if they were related to restoring the file
permissions.
Also make consistent use of
pathlib.Path
methods rather than mixingthem with
os.
methods