Skip to content

Commit

Permalink
Merge pull request #31 from marselester/fix-ujson-test
Browse files Browse the repository at this point in the history
Fix tests failing on ujson v5.9 and python v3.12
  • Loading branch information
marselester authored Jan 6, 2024
2 parents 6d054cb + 74f04ee commit 6141b3a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-e .

tox==2.9.1
tox==4.11.4
7 changes: 4 additions & 3 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_message_and_time_are_in_json_record_when_extra_is_blank(self):
'message',
'time',
])
self.assertEqual(set(json_record), expected_fields)
self.assertTrue(expected_fields.issubset(json_record))

def test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided(self):
logger.info('Sign up', extra={'fizz': 'bazz'})
Expand All @@ -68,7 +68,7 @@ def test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided(se
'time',
'fizz',
])
self.assertEqual(set(json_record), expected_fields)
self.assertTrue(expected_fields.issubset(json_record))

def test_exc_info_is_logged(self):
try:
Expand Down Expand Up @@ -213,7 +213,8 @@ def test_django_wsgi_request_is_serialized_as_empty_list(self):
if 'status_code' in json_record:
self.assertEqual(json_record['status_code'], 500)
if 'request' in json_record:
self.assertEqual(json_record['request'], [])
self.assertEqual(json_record['request']['path'], '/bogus')
self.assertEqual(json_record['request']['method'], 'BOGUS')

def test_json_circular_reference_is_handled(self):
d = {}
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tox]
envlist=py27,py35,py36,py37,py38,py39,py310
envlist=py27,py35,py36,py37,py38,py39,py310,py311,py312

[testenv]
deps=
pytest
ujson
simplejson
ujson==5.9.0
simplejson==3.19.2
django
commands=
pytest -s tests.py

0 comments on commit 6141b3a

Please sign in to comment.