File: 0007-Backport-ujson-test-fixes.patch

package info (click to toggle)
python-srsly 2.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,256 kB
  • sloc: python: 17,567; ansic: 1,434; sh: 12; makefile: 6
file content (45 lines) | stat: -rw-r--r-- 1,832 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From: Stuart Prescott <stuart@debian.org>
Date: Mon, 8 Dec 2025 17:25:21 +1100
Subject: Backport ujson test fixes

---
 srsly/tests/test_json_api.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/srsly/tests/test_json_api.py b/srsly/tests/test_json_api.py
index 89ce400..64b3654 100644
--- a/srsly/tests/test_json_api.py
+++ b/srsly/tests/test_json_api.py
@@ -55,8 +55,8 @@ def test_write_json_file():
     data = {"hello": "world", "test": 123}
     # Provide two expected options, depending on how keys are ordered
     expected = [
-        '{\n  "hello":"world",\n  "test":123\n}',
-        '{\n  "test":123,\n  "hello":"world"\n}',
+        '{\n  "hello": "world",\n  "test": 123\n}',
+        '{\n  "test": 123,\n  "hello": "world"\n}',
     ]
     with make_tempdir() as temp_dir:
         file_path = temp_dir / "tmp.json"
@@ -69,8 +69,8 @@ def test_write_json_file_gzip():
     data = {"hello": "world", "test": 123}
     # Provide two expected options, depending on how keys are ordered
     expected = [
-        '{\n  "hello":"world",\n  "test":123\n}',
-        '{\n  "test":123,\n  "hello":"world"\n}',
+        '{\n  "hello": "world",\n  "test": 123\n}',
+        '{\n  "test": 123,\n  "hello": "world"\n}',
     ]
     with make_tempdir() as temp_dir:
         file_path = force_string(temp_dir / "tmp.json")
@@ -83,8 +83,8 @@ def test_write_json_stdout(capsys):
     data = {"hello": "world", "test": 123}
     # Provide two expected options, depending on how keys are ordered
     expected = [
-        '{\n  "hello":"world",\n  "test":123\n}\n',
-        '{\n  "test":123,\n  "hello":"world"\n}\n',
+        '{\n  "hello": "world",\n  "test": 123\n}\n',
+        '{\n  "test": 123,\n  "hello": "world"\n}\n',
     ]
     write_json("-", data)
     captured = capsys.readouterr()