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

Skip to content

bpo-40058: Fix failed test_divide_and_round of test_datetime when run more than … #19213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions Lib/test/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@

TESTS = 'test.datetimetester'

try:
pure_tests = import_fresh_module(TESTS, fresh=['datetime', '_strptime'],
blocked=['_datetime'])
fast_tests = import_fresh_module(TESTS, fresh=['datetime',
'_datetime', '_strptime'])
finally:
# XXX: import_fresh_module() is supposed to leave sys.module cache untouched,
# XXX: but it does not, so we have to cleanup ourselves.
for modname in ['datetime', '_datetime', '_strptime']:
sys.modules.pop(modname, None)
pure_tests = import_fresh_module(TESTS, fresh=['datetime', '_strptime'],
blocked=['_datetime'])
fast_tests = import_fresh_module(TESTS, fresh=['datetime',
'_datetime', '_strptime'])

test_modules = [pure_tests, fast_tests]
test_suffixes = ["_Pure", "_Fast"]
# XXX(gb) First run all the _Pure tests, then all the _Fast tests. You might
Expand Down