MCPcopy
hub / github.com/psf/black / test_piping

Method test_piping

tests/test_black.py:173–191  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

171 self.assertFormatEqual(expected, actual)
172
173 def test_piping(self) -> None:
174 _, source, expected = read_data_from_file(
175 PROJECT_ROOT / "src/black/__init__.py"
176 )
177 result = BlackRunner().invoke(
178 black.main,
179 [
180 "-",
181 "--fast",
182 f"--line-length={black.DEFAULT_LINE_LENGTH}",
183 f"--config={EMPTY_CONFIG}",
184 ],
185 input=BytesIO(source.encode("utf-8")),
186 )
187 self.assertEqual(result.exit_code, 0)
188 self.assertFormatEqual(expected, result.stdout)
189 if source != result.stdout:
190 black.assert_equivalent(source, result.stdout)
191 black.assert_stable(source, result.stdout, DEFAULT_MODE)
192
193 def test_piping_diff(self) -> None:
194 diff_header = re.compile(

Callers

nothing calls this directly

Calls 3

read_data_from_fileFunction · 0.90
BlackRunnerClass · 0.85
assertFormatEqualMethod · 0.80

Tested by

no test coverage detected