Skip to content

Commit 74f04ee

Browse files
committed
Fix tests failing on ujson v5.9 and python v3.12
1 parent 6d054cb commit 74f04ee

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"]
14+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1515
steps:
1616
- uses: actions/checkout@v3
1717
- name: Set up Python ${{ matrix.python-version }}

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
-e .
22

3-
tox==2.9.1
3+
tox==4.11.4

tests.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_message_and_time_are_in_json_record_when_extra_is_blank(self):
5858
'message',
5959
'time',
6060
])
61-
self.assertEqual(set(json_record), expected_fields)
61+
self.assertTrue(expected_fields.issubset(json_record))
6262

6363
def test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided(self):
6464
logger.info('Sign up', extra={'fizz': 'bazz'})
@@ -68,7 +68,7 @@ def test_message_and_time_and_extra_are_in_json_record_when_extra_is_provided(se
6868
'time',
6969
'fizz',
7070
])
71-
self.assertEqual(set(json_record), expected_fields)
71+
self.assertTrue(expected_fields.issubset(json_record))
7272

7373
def test_exc_info_is_logged(self):
7474
try:
@@ -213,7 +213,8 @@ def test_django_wsgi_request_is_serialized_as_empty_list(self):
213213
if 'status_code' in json_record:
214214
self.assertEqual(json_record['status_code'], 500)
215215
if 'request' in json_record:
216-
self.assertEqual(json_record['request'], [])
216+
self.assertEqual(json_record['request']['path'], '/bogus')
217+
self.assertEqual(json_record['request']['method'], 'BOGUS')
217218

218219
def test_json_circular_reference_is_handled(self):
219220
d = {}

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[tox]
2-
envlist=py27,py35,py36,py37,py38,py39,py310
2+
envlist=py27,py35,py36,py37,py38,py39,py310,py311,py312
33

44
[testenv]
55
deps=
66
pytest
7-
ujson
8-
simplejson
7+
ujson==5.9.0
8+
simplejson==3.19.2
99
django
1010
commands=
1111
pytest -s tests.py

0 commit comments

Comments
 (0)