1818from functools import cached_property
1919
2020from test .support import MISSING_C_DOCSTRINGS
21- from test .support .os_helper import EnvironmentVarGuard
21+ from test .support .os_helper import EnvironmentVarGuard , FakePath
2222from test .test_zoneinfo import _support as test_support
2323from test .test_zoneinfo ._support import TZPATH_TEST_LOCK , ZoneInfoTestBase
2424from test .support .import_helper import import_module , CleanImport
@@ -1784,7 +1784,7 @@ def test_reset_tzpath_relative_paths(self):
17841784 ("/usr/share/zoneinfo" , "../relative/path" ,),
17851785 ("path/to/somewhere" , "../relative/path" ,),
17861786 ("/usr/share/zoneinfo" , "path/to/somewhere" , "../relative/path" ,),
1787- (pathlib . Path ("path/to/somewhere" ),)
1787+ (FakePath ("path/to/somewhere" ),)
17881788 ]
17891789 for input_paths in bad_values :
17901790 with self .subTest (input_paths = input_paths ):
@@ -1797,6 +1797,8 @@ def test_tzpath_type_error(self):
17971797 b"/etc/zoneinfo:/usr/share/zoneinfo" ,
17981798 0 ,
17991799 (b"/bytes/path" , "/valid/path" ),
1800+ (FakePath (b"/bytes/path" ),),
1801+ (0 ,),
18001802 ]
18011803
18021804 for bad_value in bad_values :
@@ -1807,7 +1809,7 @@ def test_tzpath_type_error(self):
18071809 def test_tzpath_attribute (self ):
18081810 tzpath_0 = [f"{ DRIVE } /one" , f"{ DRIVE } /two" ]
18091811 tzpath_1 = [f"{ DRIVE } /three" ]
1810- tzpath_pathlike = (pathlib . Path ( "{DRIVE}/usr/share/zoneinfo" ),)
1812+ tzpath_pathlike = (FakePath ( f "{ DRIVE } /usr/share/zoneinfo" ),)
18111813
18121814 with self .tzpath_context (tzpath_0 ):
18131815 query_0 = self .module .TZPATH
0 commit comments