python-json-logger icon indicating copy to clipboard operation
python-json-logger copied to clipboard

Make tests work with Python 3.13

Open befeleme opened this issue 1 year ago • 5 comments

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.

befeleme avatar Jun 10 '24 11:06 befeleme

Would keeping both decorators make it compatible?

hroncok avatar Jun 10 '24 11:06 hroncok

It seems so, I updated the PR.

befeleme avatar Jun 10 '24 11:06 befeleme

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.

nhairs avatar Jun 18 '24 11:06 nhairs

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

hroncok avatar Jun 18 '24 11:06 hroncok

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

nhairs avatar Jun 18 '24 11:06 nhairs