Merge "Mock time.time_ns in test_rfc5424_isotime_format_no_microseconds for py3.13"

This commit is contained in:
Zuul 2024-07-31 11:32:15 +00:00 committed by Gerrit Code Review
commit abd5c21ccd

View File

@ -991,6 +991,8 @@ class ContextFormatterTestCase(LogTestBase):
get_fake_datetime(
datetime.datetime(2015, 12, 16, 13, 54, 26)))
@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()))
def test_rfc5424_isotime_format_no_microseconds(self):
self.config(logging_default_format_string="%(isotime)s %(message)s")