mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
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.
This commit is contained in:
parent
8d34031068
commit
65c4a2b326
4 changed files with 14 additions and 5 deletions
|
@ -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_):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue