diff --git a/src/darker/tests/test_command_line.py b/src/darker/tests/test_command_line.py index 1255b0cfd..8cc68e831 100644 --- a/src/darker/tests/test_command_line.py +++ b/src/darker/tests/test_command_line.py @@ -17,7 +17,7 @@ from darker.__main__ import main from darker.command_line import make_argument_parser, parse_command_line from darker.config import Exclusions -from darker.formatters import black_formatter, ruff_formatter +from darker.formatters import ruff_formatter from darker.formatters.black_formatter import BlackFormatter from darker.tests.helpers import flynt_present, isort_present from darkgraylib.config import ConfigurationError diff --git a/src/darker/tests/test_formatters_black_compatible.py b/src/darker/tests/test_formatters_black_compatible.py index 006e0261a..69ea925e7 100644 --- a/src/darker/tests/test_formatters_black_compatible.py +++ b/src/darker/tests/test_formatters_black_compatible.py @@ -8,7 +8,7 @@ import pytest -from darker.formatters import black_formatter, ruff_formatter +from darker.formatters import ruff_formatter from darker.formatters.black_formatter import BlackFormatter from darker.formatters.ruff_formatter import RuffFormatter from darkgraylib.testtools.helpers import raises_or_matches @@ -82,16 +82,16 @@ def test_run(formatter_class, encoding, newline): @pytest.mark.parametrize( "formatter_setup", [ - (BlackFormatter, black_formatter, "format_str"), - (RuffFormatter, ruff_formatter, "_ruff_format_stdin"), + (BlackFormatter, "black.format_str"), + (RuffFormatter, "darker.formatters.ruff_formatter._ruff_format_stdin"), ], ) @pytest.mark.parametrize("newline", ["\n", "\r\n"]) def test_run_always_uses_unix_newlines(formatter_setup, newline): """Content is always passed to Black and Ruff with Unix newlines.""" - formatter_class, formatter_module, formatter_func_name = formatter_setup + formatter_class, formatter_func_name = formatter_setup src = TextDocument.from_str(f"print ( 'touché' ){newline}") - with patch.object(formatter_module, formatter_func_name) as formatter_func: + with patch(formatter_func_name) as formatter_func: formatter_func.return_value = 'print("touché")\n' _ = formatter_class().run(src, Path("a.py"))