Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Renamed test file to support pytest execution. Converted deprecated a…
Browse files Browse the repository at this point in the history
…ssertEquals to assertEqual. (#165)
  • Loading branch information
madzak authored Feb 14, 2023
1 parent 08d41b3 commit 4475962
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/tests.py → tests/test_jsonlogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@ def test_rename_reserved_attrs(self):
self.log.info("message")

msg = self.buffer.getvalue()
self.assertEqual(msg, '{"error.type": null, "error.message": null, "log.origin.function": "test_rename_reserved_attrs", "log.level": "INFO", "log.origin.file.name": "tests", "process.name": "MainProcess", "process.thread.name": "MainThread", "log.message": "message"}\n')
self.assertEqual(msg, '{"error.type": null, "error.message": null, "log.origin.function": "test_rename_reserved_attrs", "log.level": "INFO", "log.origin.file.name": "test_jsonlogger", "process.name": "MainProcess", "process.thread.name": "MainThread", "log.message": "message"}\n')

def test_merge_record_extra(self):
record = logging.LogRecord("name", level=1, pathname="", lineno=1, msg="Some message", args=None, exc_info=None)
output = jsonlogger.merge_record_extra(record, target=dict(foo="bar"), reserved=[])
self.assertIn("foo", output)
self.assertIn("msg", output)
self.assertEquals(output["foo"], "bar")
self.assertEquals(output["msg"], "Some message")
self.assertEqual(output["foo"], "bar")
self.assertEqual(output["msg"], "Some message")


if __name__ == '__main__':
Expand Down

0 comments on commit 4475962

Please sign in to comment.