[Python-checkins] bpo-46425: fix direct invocation of `test_fileutils` and `test_zoneinfo` (GH-30792)
asvetlov
webhook-mailer at python.org
Sat Jan 22 11:05:48 EST 2022
https://github.com/python/cpython/commit/1f8014c5b4ea7acee069ca453f6fbcad5990ebf0
commit: 1f8014c5b4ea7acee069ca453f6fbcad5990ebf0
branch: main
author: Nikita Sobolev <mail at sobolevn.me>
committer: asvetlov <andrew.svetlov at gmail.com>
date: 2022-01-22T18:05:43+02:00
summary:
bpo-46425: fix direct invocation of `test_fileutils` and `test_zoneinfo` (GH-30792)
files:
M Lib/test/test_fileutils.py
M Lib/test/test_zoneinfo/test_zoneinfo.py
diff --git a/Lib/test/test_fileutils.py b/Lib/test/test_fileutils.py
index 45b3f3233c617..ff13498fbfeb5 100644
--- a/Lib/test/test_fileutils.py
+++ b/Lib/test/test_fileutils.py
@@ -15,7 +15,7 @@ def test_capi_normalize_path(self):
if os.name == 'nt':
raise unittest.SkipTest('Windows has its own helper for this')
else:
- from .test_posixpath import PosixPathTest as posixdata
+ from test.test_posixpath import PosixPathTest as posixdata
tests = posixdata.NORMPATH_CASES
for filename, expected in tests:
if not os.path.isabs(filename):
diff --git a/Lib/test/test_zoneinfo/test_zoneinfo.py b/Lib/test/test_zoneinfo/test_zoneinfo.py
index 59b35ef63f987..a2172f3ac21d0 100644
--- a/Lib/test/test_zoneinfo/test_zoneinfo.py
+++ b/Lib/test/test_zoneinfo/test_zoneinfo.py
@@ -17,8 +17,8 @@
from datetime import date, datetime, time, timedelta, timezone
from functools import cached_property
-from . import _support as test_support
-from ._support import OS_ENV_LOCK, TZPATH_TEST_LOCK, ZoneInfoTestBase
+from test.test_zoneinfo import _support as test_support
+from test.test_zoneinfo._support import OS_ENV_LOCK, TZPATH_TEST_LOCK, ZoneInfoTestBase
from test.support.import_helper import import_module
lzma = import_module('lzma')
@@ -2107,3 +2107,7 @@ def _Pacific_Kiritimati():
_ZONEDUMP_DATA = None
_FIXED_OFFSET_ZONES = None
+
+
+if __name__ == '__main__':
+ unittest.main()
More information about the Python-checkins
mailing list