(self)
| 2242 | |
| 2243 | @event_loop() |
| 2244 | def test_cache_multiple_files(self) -> None: |
| 2245 | mode = DEFAULT_MODE |
| 2246 | with ( |
| 2247 | cache_dir() as workspace, |
| 2248 | patch("concurrent.futures.ProcessPoolExecutor", new=ThreadPoolExecutor), |
| 2249 | ): |
| 2250 | one = (workspace / "one.py").resolve() |
| 2251 | one.write_text("print('hello')", encoding="utf-8") |
| 2252 | two = (workspace / "two.py").resolve() |
| 2253 | two.write_text("print('hello')", encoding="utf-8") |
| 2254 | cache = black.Cache.read(mode) |
| 2255 | cache.write([one]) |
| 2256 | invokeBlack([str(workspace)]) |
| 2257 | assert one.read_text(encoding="utf-8") == "print('hello')" |
| 2258 | assert two.read_text(encoding="utf-8") == 'print("hello")\n' |
| 2259 | cache = black.Cache.read(mode) |
| 2260 | assert not cache.is_changed(one) |
| 2261 | assert not cache.is_changed(two) |
| 2262 | |
| 2263 | @pytest.mark.incompatible_with_mypyc |
| 2264 | @pytest.mark.parametrize("color", [False, True], ids=["no-color", "with-color"]) |
nothing calls this directly
no test coverage detected