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

Eric Snow report at bugs.python.org
Wed May 6 12:03:27 EDT 2020


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

FYI, with the following additions in Lib/test/test_datetime.py...

   before = set(sys.modules)
   try:
       pure_tests = import_fresh_module(TESTS, fresh=['datetime', '_strptime'],
                                     blocked=['_datetime'])
       _pure = set(sys.modules)
       fast_tests = import_fresh_module(TESTS, fresh=['datetime',
                                                      '_datetime', '_strptime'])
       _fast = set(sys.modules)
       print(f'added (pure): {sorted(_pure-before)}')
       print(f'added (fast): {sorted(_fast-before)}')
       print('---')
   finally:
      ...

I get the following output running "./python -m test test_datetime test_datetime":

   0:00:00 load avg: 0.52 Run tests sequentially
   0:00:00 load avg: 0.52 [1/2] test_datetime
   added (pure): ['_decimal', '_strptime', '_testcapi', 'decimal', 'numbers', 'test.datetimetester']
   added (fast): ['_decimal', '_strptime', '_testcapi', 'decimal', 'numbers', 'test.datetimetester']
   ---
   0:00:05 load avg: 0.52 [2/2] test_datetime
   added (pure): ['_datetime', '_strptime', 'datetime']
   added (fast): ['_datetime', '_strptime', 'datetime']
   ---
   [snipped]

That definitely tells a story. :)  Unfortunately, for now I don't have any more time to investigate.  Sorry.

----------
nosy: +eric.snow

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


More information about the Python-bugs-list mailing list