generated from tophat/new-project-kit
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(json): serialize None as null, close #622
BREAKING CHANGE: The JSONSnapshotExtension now serializes Python's None as "null" rather than "None".
- Loading branch information
Noah Negin-Ulster
committed
Dec 30, 2022
1 parent
f9c6aba
commit c330680
Showing
6 changed files
with
6 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tensions/json/__snapshots__/test_json_filters/test_exclude_in_json_with_empty_values.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"empty_dict": {}, | ||
"empty_list": [], | ||
"none": "None" | ||
"none": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,6 @@ | |
"datetime": "2021-01-31T23:59:00.000000", | ||
"float": 4.2, | ||
"int": -1, | ||
"null": "None", | ||
"null": null, | ||
"str": "foo" | ||
} |
1 change: 1 addition & 0 deletions
1
tests/syrupy/extensions/json/__snapshots__/test_json_serializer/test_dict[actual2].json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"a": "Some ttext.", | ||
"key": null, | ||
"multi\nline\nkey": "Some morre text." | ||
} |
2 changes: 1 addition & 1 deletion
2
tests/syrupy/extensions/json/__snapshots__/test_json_serializer/test_empty_snapshot.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"None" | ||
null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c330680
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
benchmarks/test_1000x.py::test_1000x_reads
0.7565940890112609
iter/sec (stddev: 0.05404360420624151
)0.8381195242511715
iter/sec (stddev: 0.04240394140227035
)1.11
benchmarks/test_1000x.py::test_1000x_writes
0.7551367850943955
iter/sec (stddev: 0.06249030230473292
)0.8626650008455868
iter/sec (stddev: 0.05153168408309042
)1.14
benchmarks/test_standard.py::test_standard
0.720072681359854
iter/sec (stddev: 0.06677892596066112
)0.7465173870618954
iter/sec (stddev: 0.1502009356924296
)1.04
This comment was automatically generated by workflow using github-action-benchmark.