X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/b1d060101626aa1c332f52e4bdf0ae5e4cc07990..3500e1cda5bef73ddc7eaf79be6c67c918738936:/tests/test_ipynb.py?ds=sidebyside 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)