Skip to content

Commit bb1addc

Browse files
committed
add a test for an absolute os.Pathlike in TZPATH
1 parent d52c859 commit bb1addc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/test/test_zoneinfo/test_zoneinfo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,15 +1806,20 @@ def test_tzpath_type_error(self):
18061806
def test_tzpath_attribute(self):
18071807
tzpath_0 = [f"{DRIVE}/one", f"{DRIVE}/two"]
18081808
tzpath_1 = [f"{DRIVE}/three"]
1809+
tzpath_pathlike = (pathlib.Path("/usr/share/zoneinfo"),)
18091810

18101811
with self.tzpath_context(tzpath_0):
18111812
query_0 = self.module.TZPATH
18121813

18131814
with self.tzpath_context(tzpath_1):
18141815
query_1 = self.module.TZPATH
18151816

1817+
with self.tzpath_context(tzpath_pathlike):
1818+
query_pathlike = self.module.TZPATH
1819+
18161820
self.assertSequenceEqual(tzpath_0, query_0)
18171821
self.assertSequenceEqual(tzpath_1, query_1)
1822+
self.assertSequenceEqual(tzpath_pathlike, query_pathlike)
18181823

18191824

18201825
class CTzPathTest(TzPathTest):

0 commit comments

Comments
 (0)