diff options
author | Paul Ganssle <git@m.ganssle.io> | 2023-03-23 14:36:47 (GMT) |
---|---|---|
committer | T. Wouters <thomas@python.org> | 2023-05-03 09:09:45 (GMT) |
commit | 65c4a2b326086875ecbedf032204d1ff24ba74d7 (patch) | |
tree | 795e51769463ee73421daefc1602bc0a4e0b7f1f /Lib/test/test_datetime.py | |
parent | 8d34031068ece75667260f6526d3165efe34e054 (diff) | |
download | cpython-65c4a2b326086875ecbedf032204d1ff24ba74d7.zip cpython-65c4a2b326086875ecbedf032204d1ff24ba74d7.tar.gz cpython-65c4a2b326086875ecbedf032204d1ff24ba74d7.tar.bz2 |
GH-84976: Move Lib/datetime.py to Lib/_pydatetime
This breaks the tests, but we are keeping it as a separate commit so
that the move operation and editing of the moved files are separate, for
a cleaner history.
Diffstat (limited to 'Lib/test/test_datetime.py')
-rw-r--r-- | Lib/test/test_datetime.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py index 7f9094f..3859733 100644 --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -8,10 +8,12 @@ TESTS = 'test.datetimetester' def load_tests(loader, tests, pattern): try: - pure_tests = import_fresh_module(TESTS, fresh=['datetime', '_strptime'], - blocked=['_datetime']) - fast_tests = import_fresh_module(TESTS, fresh=['datetime', - '_datetime', '_strptime']) + pure_tests = import_fresh_module(TESTS, + fresh=['datetime', '_pydatetime', '_strptime'], + blocked=['_datetime']) + fast_tests = import_fresh_module(TESTS, + fresh=['datetime', '_strptime'], + blocked=['_pydatetime']) finally: # XXX: import_fresh_module() is supposed to leave sys.module cache untouched, # XXX: but it does not, so we have to cleanup ourselves. @@ -42,6 +44,8 @@ def load_tests(loader, tests, pattern): cls_._save_sys_modules = sys.modules.copy() sys.modules[TESTS] = module sys.modules['datetime'] = module.datetime_module + if hasattr(module, '_pydatetime'): + sys.modules['_pydatetime'] = module._pydatetime sys.modules['_strptime'] = module._strptime @classmethod def tearDownClass(cls_): |