Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccdbaa6

Browse files
committed
Better use __file__
1 parent 303255f commit ccdbaa6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Lib/test/test_zoneinfo/test_zoneinfo.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,20 +1729,14 @@ def test_env_variable_relative_paths(self):
17291729
"InvalidTZPathWarning",
17301730
)
17311731
# It should represent the current file:
1732-
self.assertTrue(
1733-
wlog[0].filename.endswith("test_zoneinfo.py"),
1734-
msg=wlog[0].filename,
1735-
)
1732+
self.assertEqual(wlog[0].filename, __file__)
17361733

17371734
with self.subTest("warning", path_var=path_var):
17381735
# Note: Per PEP 615 the warning is implementation-defined
17391736
# behavior, other implementations need not warn.
17401737
with self.assertWarns(self.module.InvalidTZPathWarning) as w:
17411738
self.module.reset_tzpath()
1742-
self.assertTrue(
1743-
w.warnings[0].filename.endswith("test_zoneinfo.py"),
1744-
msg=w.warnings[0].filename,
1745-
)
1739+
self.assertEqual(w.warnings[0].filename, __file__)
17461740

17471741
tzpath = self.module.TZPATH
17481742
with self.subTest("filtered", path_var=path_var):

0 commit comments

Comments
 (0)