MCPcopy Create free account
hub / github.com/psf/black / test_nested_gitignore

Method test_nested_gitignore

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

Source from the content-addressed store, hash-verified

2247 assert sorted(expected) == sorted(sources)
2248
2249 def test_nested_gitignore(self) -> None:
2250 path = Path(THIS_DIR / "data" / "nested_gitignore_tests")
2251 include = re.compile(r"\.pyi?$")
2252 exclude = re.compile(r"")
2253 root_gitignore = black.files.get_gitignore(path)
2254 report = black.Report()
2255 expected: List[Path] = [
2256 Path(path / "x.py"),
2257 Path(path / "root/b.py"),
2258 Path(path / "root/c.py"),
2259 Path(path / "root/child/c.py"),
2260 ]
2261 this_abs = THIS_DIR.resolve()
2262 sources = list(
2263 black.gen_python_files(
2264 path.iterdir(),
2265 this_abs,
2266 include,
2267 exclude,
2268 None,
2269 None,
2270 report,
2271 {path: root_gitignore},
2272 verbose=False,
2273 quiet=False,
2274 )
2275 )
2276 assert sorted(expected) == sorted(sources)
2277
2278 def test_nested_gitignore_directly_in_source_directory(self) -> None:
2279 # https://github.com/psf/black/issues/2598

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected