Package: src:python-json-log-formatter
Version: 0.5.2-2
Severity: serious
Tags: sid trixie ftbfs
User: debian-pyt...@lists.debian.org
Usertags: python3.12

With python3-defaults from experimental, the package fails to build:

[...]
============================= test session starts ==============================
platform linux -- Python 3.12.1, pytest-7.4.4, pluggy-1.4.0
cachedir: .tox/py312/.pytest_cache
rootdir: /<<PKGBUILDDIR>>
collected 29 items

tests.py ...FF........................

=================================== FAILURES =================================== _ JSONFormatterTest.test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided _

self = <tests.JSONFormatterTest testMethod=test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided>

def test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided(self):
        logger.info('Sign up', extra={'fizz': 'bazz'})
        json_record = json.loads(log_buffer.getvalue())
        expected_fields = set([
            'message',
            'time',
            'fizz',
        ])
>       self.assertEqual(set(json_record), expected_fields)
E       AssertionError: Items in the first set but not the second:
E       'taskName'

tests.py:72: AssertionError
------------------------------ Captured log call -------------------------------
INFO     test:tests.py:65 Sign up
_ JSONFormatterTest.test_message_and_time_are_in_json_record_when_extra_is_blank _

self = <tests.JSONFormatterTest testMethod=test_message_and_time_are_in_json_record_when_extra_is_blank>

    def test_message_and_time_are_in_json_record_when_extra_is_blank(self):
        logger.info('Sign up')
        json_record = json.loads(log_buffer.getvalue())
        expected_fields = set([
            'message',
            'time',
        ])
>       self.assertEqual(set(json_record), expected_fields)
E       AssertionError: Items in the first set but not the second:
E       'taskName'

tests.py:62: AssertionError
------------------------------ Captured log call -------------------------------
INFO     test:tests.py:56 Sign up
=============================== warnings summary ===============================
tests.py: 28 warnings
/<<PKGBUILDDIR>>/json_log_formatter/__init__.py:123: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    extra['time'] = datetime.utcnow()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================ FAILED tests.py::JSONFormatterTest::test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided FAILED tests.py::JSONFormatterTest::test_message_and_time_are_in_json_record_when_extra_is_blank ================== 2 failed, 27 passed, 28 warnings in 0.17s ===================
py312: exit 1 (0.36 seconds) /<<PKGBUILDDIR>>> pytest -s tests.py pid=5939

Reply via email to