Mock time.time_ns in test_rfc5424_isotime_format_no_microseconds for py3.13
In python 3.13, the logging module has moved to use time_ns() instead of
time() for the `created` attribute [1].
[1] 1316692e8c
Change-Id: I8dfd02964fc278ac16bb311ed102a7cfc63aa059
This commit is contained in:
parent
60c39a3b87
commit
e762ada33f
@ -991,6 +991,8 @@ class ContextFormatterTestCase(LogTestBase):
|
|||||||
get_fake_datetime(
|
get_fake_datetime(
|
||||||
datetime.datetime(2015, 12, 16, 13, 54, 26)))
|
datetime.datetime(2015, 12, 16, 13, 54, 26)))
|
||||||
@mock.patch("time.time", new=mock.Mock(return_value=1450274066.000000))
|
@mock.patch("time.time", new=mock.Mock(return_value=1450274066.000000))
|
||||||
|
@mock.patch("time.time_ns",
|
||||||
|
new=mock.Mock(return_value=1450274066000000000))
|
||||||
@mock.patch("dateutil.tz.tzlocal", new=mock.Mock(return_value=tz.tzutc()))
|
@mock.patch("dateutil.tz.tzlocal", new=mock.Mock(return_value=tz.tzutc()))
|
||||||
def test_rfc5424_isotime_format_no_microseconds(self):
|
def test_rfc5424_isotime_format_no_microseconds(self):
|
||||||
self.config(logging_default_format_string="%(isotime)s %(message)s")
|
self.config(logging_default_format_string="%(isotime)s %(message)s")
|
||||||
|
Loading…
Reference in New Issue
Block a user