(self)
| 1176 | self.assertFormatEqual(actual, expected) |
| 1177 | |
| 1178 | def test_single_file_force_py36(self) -> None: |
| 1179 | reg_mode = DEFAULT_MODE |
| 1180 | py36_mode = replace(DEFAULT_MODE, target_versions=PY36_VERSIONS) |
| 1181 | source, expected = read_data("miscellaneous", "force_py36") |
| 1182 | with cache_dir() as workspace: |
| 1183 | path = (workspace / "file.py").resolve() |
| 1184 | path.write_text(source, encoding="utf-8") |
| 1185 | self.invokeBlack([str(path), *PY36_ARGS]) |
| 1186 | actual = path.read_text(encoding="utf-8") |
| 1187 | # verify cache with --target-version is separate |
| 1188 | py36_cache = black.Cache.read(py36_mode) |
| 1189 | assert not py36_cache.is_changed(path) |
| 1190 | normal_cache = black.Cache.read(reg_mode) |
| 1191 | assert normal_cache.is_changed(path) |
| 1192 | self.assertEqual(actual, expected) |
| 1193 | |
| 1194 | @event_loop() |
| 1195 | def test_multi_file_force_py36(self) -> None: |
nothing calls this directly
no test coverage detected