]> git.apps.os.sepia.ceph.com Git - teuthology.git/commit
test_misc.py: fix bad assumption about LogRecord fields
authorDan Mick <dmick@redhat.com>
Tue, 16 Nov 2021 01:37:23 +0000 (17:37 -0800)
committerDan Mick <dmick@redhat.com>
Tue, 23 Nov 2021 01:34:41 +0000 (17:34 -0800)
commitb7dbe07d009e61affb16bf459dbb88bc1c4b86ad
treebabb50ce0d0cd5410da663637592cbcc0b8cb75c
parent6cfddd5e1c7d5ede1367cf3087c21af44eb88356
test_misc.py: fix bad assumption about LogRecord fields

The test was using LogRecord's asctime attribute to calculate a time
difference between two log entries.  Although the attribute is documented
with no caveat, others have run into the problem that it does not exist
on logging.LogRecord unless a formatter with a format string referencing
{asctime} has been used.  Since there's a 'created' time that's more
appropriate for this test anyway, use that instead.

This commit enables updating pytest, because pytest's logging init
code has changed: https://github.com/pytest-dev/pytest/discussions/9324

Signed-off-by: Dan Mick <dmick@redhat.com>
teuthology/test/test_misc.py