madzak / python-json-logger

Json Formatter for the standard python logger
BSD 2-Clause "Simplified" License
1.7k stars 231 forks source link

Make tests work with Python 3.13 #192

Open befeleme opened 3 weeks ago

befeleme commented 3 weeks ago

Attribute created of LogRecord is time.time_ns since Python 3.13: https://docs.python.org/3.13/library/logging.html#logrecord-attributes

This is not a backwards compatible change.

hroncok commented 3 weeks ago

Would keeping both decorators make it compatible?

befeleme commented 3 weeks ago

It seems so, I updated the PR.

nhairs commented 2 weeks ago

Hi @befeleme, @hroncok,

Just so you're aware it looks like python-json-logger is currently unmaintained, that said I am working on a maintained fork which includes testing against Python 3.13.

hroncok commented 2 weeks ago

FWIW I don't see this test in your fork.

nhairs commented 2 weeks ago

FWIW I don't see this test in your fork.

The test on the timestamp does still exist, however I've moved to using freezegun over unittest.mock.

https://github.com/nhairs/python-json-logger/blob/main/tests/test_formatters.py#L452