X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/1af533108968e40cc005079a328ad117a864af13..39b55f787cff41ef9726b256cfdbedefe6d5c716:/tests/test_ipynb.py diff --git a/tests/test_ipynb.py b/tests/test_ipynb.py index 038155e..12f176c 100644 --- a/tests/test_ipynb.py +++ b/tests/test_ipynb.py @@ -453,3 +453,12 @@ def test_ipynb_and_pyi_flags() -> None: assert isinstance(result.exception, SystemExit) expected = "Cannot pass both `pyi` and `ipynb` flags!\n" assert result.output == expected + + +def test_unable_to_replace_magics(monkeypatch: MonkeyPatch) -> None: + src = "%%time\na = 'foo'" + monkeypatch.setattr("black.handle_ipynb_magics.TOKEN_HEX", lambda _: "foo") + with pytest.raises( + AssertionError, match="Black was not able to replace IPython magic" + ): + format_cell(src, fast=True, mode=JUPYTER_MODE)