Skip to content

Commit

Permalink
make test compatible with ipython 8.3.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Apr 11, 2022
1 parent 497a725 commit 0776de9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from contextlib import ExitStack as does_not_raise
from typing import ContextManager

import IPython
from click.testing import CliRunner
from black.handle_ipynb_magics import jupyter_dependencies_are_installed
from black import (
Expand Down Expand Up @@ -139,10 +140,15 @@ def test_non_python_magics(src: str) -> None:
format_cell(src, fast=True, mode=JUPYTER_MODE)


@pytest.mark.skipif(
IPython.version_info < (8, 3),
reason="Change in how TransformerManager transforms this input",
)
def test_set_input() -> None:
src = "a = b??"
with pytest.raises(NothingChanged):
format_cell(src, fast=True, mode=JUPYTER_MODE)
expected = "??b"
result = format_cell(src, fast=True, mode=JUPYTER_MODE)
assert result == expected


def test_input_already_contains_transformed_magic() -> None:
Expand Down

0 comments on commit 0776de9

Please sign in to comment.