[issue40058] Running test_datetime twice fails with: module 'datetime' has no attribute '_divide_and_round'

hai shi report at bugs.python.org
Wed Mar 25 14:54:40 EDT 2020


hai shi <shihai1991 at 126.com> added the comment:

add a pdb point in L11 of test_datetime.py

  8     try:
  9         pure_tests = import_fresh_module(TESTS, fresh=['datetime', '_strptime'],
 10                                          blocked=['_datetime'])
 11         import pdb;pdb.set_trace()
 12  ->     fast_tests = import_fresh_module(TESTS, fresh=['datetime',
 13                                                        '_datetime', '_strptime'])

and run `./python -m test test_datetime test_datetime`:
the first iteration:
(Pdb) pure_tests.datetime_module._divide_and_round
<function _divide_and_round at 0x7f694df8e7e0>
the second iteration(`_datetime` not blocked?):
(Pdb) pure_tests.datetime_module._divide_and_round
*** AttributeError: module 'datetime' has no attribute '_divide_and_round'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40058>
_______________________________________


More information about the Python-bugs-list mailing list