diff options
Diffstat (limited to 'dev-python/python-json-logger/files/python-json-logger-2.0.7-py313.patch')
-rw-r--r-- | dev-python/python-json-logger/files/python-json-logger-2.0.7-py313.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dev-python/python-json-logger/files/python-json-logger-2.0.7-py313.patch b/dev-python/python-json-logger/files/python-json-logger-2.0.7-py313.patch new file mode 100644 index 000000000000..8421617783da --- /dev/null +++ b/dev-python/python-json-logger/files/python-json-logger-2.0.7-py313.patch @@ -0,0 +1,25 @@ +diff --git a/tests/test_jsonlogger.py b/tests/test_jsonlogger.py +index af369d2..068e760 100644 +--- a/tests/test_jsonlogger.py ++++ b/tests/test_jsonlogger.py +@@ -176,13 +176,17 @@ def test_json_default_encoder(self): + "1900-01-01T00:00:00") + + @unittest.mock.patch('time.time', return_value=1500000000.0) +- def test_json_default_encoder_with_timestamp(self, time_mock): ++ @unittest.mock.patch('time.time_ns', return_value=1500000000000000000) ++ def test_json_default_encoder_with_timestamp(self, time_ns_mock, time_mock): + fr = jsonlogger.JsonFormatter(timestamp=True) + self.log_handler.setFormatter(fr) + + self.log.info("Hello") +- +- self.assertTrue(time_mock.called) ++ ++ if sys.version_info < (3, 13): ++ self.assertTrue(time_mock.called) ++ else: ++ self.assertTrue(time_ns_mock.called) + log_json = json.loads(self.buffer.getvalue()) + self.assertEqual(log_json.get("timestamp"), "2017-07-14T02:40:00+00:00") + |