gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065)

This commit is contained in:
Serhiy Storchaka 2024-05-16 10:25:10 +03:00 committed by GitHub
parent 0142a2292c
commit 0152dc4ff5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 115 additions and 127 deletions

View file

@ -657,15 +657,15 @@ class HandlerTest(BaseTest):
self.assertFalse(h.shouldFlush(r))
h.close()
def test_path_objects(self):
def test_pathlike_objects(self):
"""
Test that Path objects are accepted as filename arguments to handlers.
Test that path-like objects are accepted as filename arguments to handlers.
See Issue #27493.
"""
fn = make_temp_file()
os.unlink(fn)
pfn = pathlib.Path(fn)
pfn = os_helper.FakePath(fn)
cases = (
(logging.FileHandler, (pfn, 'w')),
(logging.handlers.RotatingFileHandler, (pfn, 'a')),