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

Function check_file

tests/test_format.py:26–49  ·  view source on GitHub ↗
(subdir: str, filename: str, *, data: bool = True)

Source from the content-addressed store, hash-verified

24
25
26def check_file(subdir: str, filename: str, *, data: bool = True) -> None:
27 args, source, expected = read_data_with_mode(subdir, filename, data=data)
28 assert_format(
29 source,
30 expected,
31 args.mode,
32 fast=args.fast,
33 minimum_version=args.minimum_version,
34 lines=args.lines,
35 no_preview_line_length_1=args.no_preview_line_length_1,
36 )
37 if args.minimum_version is not None:
38 major, minor = args.minimum_version
39 target_version = TargetVersion[f"PY{major}{minor}"]
40 mode = replace(args.mode, target_versions={target_version})
41 assert_format(
42 source,
43 expected,
44 mode,
45 fast=args.fast,
46 minimum_version=args.minimum_version,
47 lines=args.lines,
48 no_preview_line_length_1=args.no_preview_line_length_1,
49 )
50
51
52@pytest.mark.filterwarnings("ignore:invalid escape sequence.*:DeprecationWarning")

Callers 1

test_simple_formatFunction · 0.85

Calls 3

read_data_with_modeFunction · 0.90
assert_formatFunction · 0.90
replaceFunction · 0.85

Tested by

no test coverage detected