Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests failing on ujson v5.9 and python v3.12 #31

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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