Skip to content

Commit f72edc5

Browse files
committed
Add test for json lines with an explicit file
1 parent cc9ee36 commit f72edc5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/test_json/test_tool.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ def test_jsonlines(self):
156156
self.assertEqual(process.stdout, self.jsonlines_expect)
157157
self.assertEqual(process.stderr, '')
158158

159+
@force_not_colorized
160+
def test_jsonlines_with_file(self):
161+
infile = self._create_infile(self.jsonlines_raw)
162+
args = sys.executable, '-m', self.module, '--json-lines', infile
163+
process = subprocess.run(args, capture_output=True, text=True, check=True)
164+
self.assertEqual(process.stdout, self.jsonlines_expect)
165+
self.assertEqual(process.stderr, '')
166+
159167
def test_help_flag(self):
160168
rc, out, err = assert_python_ok('-m', self.module, '-h',
161169
PYTHON_COLORS='0')

0 commit comments

Comments
 (0)