(self)
| 1127 | self.invokeBlack([str(workspace.resolve())]) |
| 1128 | |
| 1129 | def test_single_file_force_pyi(self) -> None: |
| 1130 | pyi_mode = replace(DEFAULT_MODE, is_pyi=True) |
| 1131 | contents, expected = read_data("miscellaneous", "force_pyi") |
| 1132 | with cache_dir() as workspace: |
| 1133 | path = (workspace / "file.py").resolve() |
| 1134 | path.write_text(contents, encoding="utf-8") |
| 1135 | self.invokeBlack([str(path), "--pyi"]) |
| 1136 | actual = path.read_text(encoding="utf-8") |
| 1137 | # verify cache with --pyi is separate |
| 1138 | pyi_cache = black.Cache.read(pyi_mode) |
| 1139 | assert not pyi_cache.is_changed(path) |
| 1140 | normal_cache = black.Cache.read(DEFAULT_MODE) |
| 1141 | assert normal_cache.is_changed(path) |
| 1142 | self.assertFormatEqual(expected, actual) |
| 1143 | black.assert_equivalent(contents, actual) |
| 1144 | black.assert_stable(contents, actual, pyi_mode) |
| 1145 | |
| 1146 | @event_loop() |
| 1147 | def test_multi_file_force_pyi(self) -> None: |
nothing calls this directly
no test coverage detected