Skip to content

Commit ed60cda

Browse files
committed
Add test case that fails on main
1 parent 3b681b3 commit ed60cda

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{"ingredients":["frog", "water", "chocolate", "glucose"]}
2+
{"ingredients":["chocolate","steel bolts"]}

Lib/test/test_json/test_tool.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import errno
2+
import pathlib
23
import os
34
import sys
45
import textwrap
@@ -156,6 +157,14 @@ def test_jsonlines(self):
156157
self.assertEqual(process.stdout, self.jsonlines_expect)
157158
self.assertEqual(process.stderr, '')
158159

160+
@force_not_colorized
161+
def test_jsonlines_from_file(self):
162+
jsonl = pathlib.Path(__file__).parent / 'json_lines.jsonl'
163+
args = sys.executable, '-m', self.module, '--json-lines', jsonl
164+
process = subprocess.run(args, capture_output=True, text=True, check=True)
165+
self.assertEqual(process.stdout, self.jsonlines_expect)
166+
self.assertEqual(process.stderr, '')
167+
159168
def test_help_flag(self):
160169
rc, out, err = assert_python_ok('-m', self.module, '-h',
161170
PYTHON_COLORS='0')

0 commit comments

Comments
 (0)