Skip to content

Disable hard-wrapping for all console print functions#1656

Merged
nathanjmcdougall merged 5 commits intomainfrom
copilot/disable-hard-wrapping-all-commands
Mar 31, 2026
Merged

Disable hard-wrapping for all console print functions#1656
nathanjmcdougall merged 5 commits intomainfrom
copilot/disable-hard-wrapping-all-commands

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

  • Add soft_wrap=True to all console.print() calls in _console.py (tick_print, instruct_print, how_print, info_print, err_print, warn_print)
  • Remove .replace("\n", "") workarounds in tests/usethis/_core/test_core_tool.py (7 instances)
  • Remove .replace("\n", "") workarounds in tests/usethis/_ui/interface/test_rule.py (2 instances)
  • Remove .replace("\n", "") workarounds in tests/usethis/_ui/interface/test_lint.py (2 instances)
  • Remove .replace("\n", " ") workaround in tests/usethis/_tool/test_base.py (1 instance)
  • Add test_no_line_wrapping tests in test_console.py for tick_print, instruct_print, info_print, err_print, warn_print
  • Fix additional tests with hard-wrapped output expectations:
    • test_core_tool.py: 6 assertions with embedded \n wrapping in dependency/rule messages
    • test_deps.py: 1 assertion with embedded \n wrapping
    • test_pyproject_toml.py: 1 assertion with embedded \n wrapping in warning message
    • test_tool.py: 2 assertions with embedded \n wrapping (pyproject.toml how, ruff readme example)
  • Run static checks (prek, basedpyright)

Skills used: usethis-qa-static-checks

Resolves #1751

Copilot AI and others added 2 commits March 30, 2026 22:30
…karounds

- Add soft_wrap=True to tick_print, instruct_print, how_print, info_print,
  err_print, and warn_print (via _cached_warn_print) in _console.py
- Remove .replace("\n", "") workarounds from test_core_tool.py (7 instances)
- Remove .replace("\n", "") workarounds from test_rule.py (2 instances)
- Remove .replace("\n", "") workarounds from test_lint.py (2 instances)
- Remove .replace("\n", " ").replace("  ", " ") workaround from test_base.py
- Add test_no_line_wrapping tests for tick_print, instruct_print, info_print,
  err_print, and warn_print in test_console.py

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/83ad3589-83a9-4f1f-8e8c-bacca08c9660

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with hard-wrapping in commands Disable hard-wrapping for all console print functions Mar 30, 2026
Copilot AI requested a review from nathanjmcdougall March 30, 2026 22:34
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 30, 2026 22:40
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 30, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/disable-hard-wrapping-all-commands (c1a3c0b) with main (e9a5c2f)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (b949a41) during the generation of this report, so e9a5c2f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

@copilot please fix failing tests

Details
=================================== FAILURES ===================================
_______ TestCoverage.TestAdd.test_pytest_integration[NetworkConn.ONLINE] _______

self = <tests.usethis._core.test_core_tool.TestCoverage.TestAdd object at 0x10320f370>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_pytest_integration_Networ0')
capfd = <_pytest.capture.CaptureFixture object at 0x10379b010>

    @pytest.mark.usefixtures("_vary_network_conn")
    def test_pytest_integration(
        self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
    ):
        with change_cwd(uv_init_dir), files_manager():
            # Arrange
            with usethis_config.set(quiet=True):
                use_pytest()
    
            # Act
            use_coverage_py()
    
            # Assert
            assert Dependency(
                name="coverage", extras=frozenset({"toml"})
            ) in get_deps_from_group("test")
            out, err = capfd.readouterr()
            assert not err
>           assert out == (
                "✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in \n'pyproject.toml'.\n"
                "☐ Install the dependencies 'coverage', 'pytest-cov'.\n"
                "✔ Adding Coverage.py config to 'pyproject.toml'.\n"
                "☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
            )
E           AssertionError: assert '✔ Adding dep...overage.py.\n' == '✔ Adding dep...overage.py.\n'
E             
E             - ✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 
E             + ✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 'pyproject.toml'.
E             ?                                                                       +++++++++++++++++
E             - 'pyproject.toml'.
E               ☐ Install the dependencies 'coverage', 'pytest-cov'.
E               ✔ Adding Coverage.py config to 'pyproject.toml'.
E               ☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.

capfd      = <_pytest.capture.CaptureFixture object at 0x10379b010>
err        = ''
out        = "✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 'pyproject.toml'.\n☐ Install the dependencies '....\n✔ Adding Coverage.py config to 'pyproject.toml'.\n☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
self       = <tests.usethis._core.test_core_tool.TestCoverage.TestAdd object at 0x10320f370>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_pytest_integration_Networ0')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_core/test_core_tool.py:395: AssertionError
_______ TestPytest.TestAdd.test_coverage_integration[NetworkConn.ONLINE] _______

self = <tests.usethis._core.test_core_tool.TestPytest.TestAdd object at 0x103ef3a30>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_coverage_integration_Netw0')
capfd = <_pytest.capture.CaptureFixture object at 0x104ab0bb0>

    @pytest.mark.usefixtures("_vary_network_conn")
    def test_coverage_integration(
        self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
    ):
        with change_cwd(uv_init_dir), files_manager():
            # Arrange
            with usethis_config.set(quiet=True):
                use_coverage_py()
    
            # Act
            use_pytest()
    
        # Assert
        out, _ = capfd.readouterr()
>       assert out == (
            "✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in \n'pyproject.toml'.\n"
            "☐ Install the dependencies 'pytest', 'pytest-cov'.\n"
            "✔ Adding pytest config to 'pyproject.toml'.\n"
            "✔ Creating '/tests'.\n"
            "✔ Writing '/tests/conftest.py'.\n"
            "☐ Add test files to the '/tests' directory with the format 'test_*.py'.\n"
            "☐ Add test functions with the format 'test_*()'.\n"
            "☐ Run 'uv run pytest' to run the tests.\n"
            "☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
        )
E       AssertionError: assert '✔ Adding dep...overage.py.\n' == '✔ Adding dep...overage.py.\n'
E         
E         - ✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 
E         + ✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 'pyproject.toml'.
E         ?                                                                     +++++++++++++++++
E         - 'pyproject.toml'.
E           ☐ Install the dependencies 'pytest', 'pytest-cov'.
E           ✔ Adding pytest config to 'pyproject.toml'.
E           ✔ Creating '/tests'.
E           ✔ Writing '/tests/conftest.py'.
E           ☐ Add test files to the '/tests' directory with the format 'test_*.py'.
E           ☐ Add test functions with the format 'test_*()'.
E           ☐ Run 'uv run pytest' to run the tests.
E           ☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.

_          = ''
capfd      = <_pytest.capture.CaptureFixture object at 0x104ab0bb0>
out        = "✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 'pyproject.toml'.\n☐ Install the dependencies 'py...test_*()'.\n☐ Run 'uv run pytest' to run the tests.\n☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
self       = <tests.usethis._core.test_core_tool.TestPytest.TestAdd object at 0x103ef3a30>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_coverage_integration_Netw0')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_core/test_core_tool.py:2520: AssertionError
_______________ TestRuff.TestAdd.test_stdout[NetworkConn.ONLINE] _______________

self = <tests.usethis._core.test_core_tool.TestRuff.TestAdd object at 0x10361f490>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_stdout_NetworkConn_ONLINE2')
capfd = <_pytest.capture.CaptureFixture object at 0x104ab36d0>

    @pytest.mark.usefixtures("_vary_network_conn")
    def test_stdout(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]):
        # Act
        with change_cwd(uv_init_dir), files_manager():
            use_ruff()
    
        # Assert
        out, _ = capfd.readouterr()
>       assert out == (
            "✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.\n"
            "☐ Install the dependency 'ruff'.\n"
            "✔ Adding Ruff config to 'pyproject.toml'.\n"
            "✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', \n'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.\n"
            "✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.\n"
            "☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.\n"
            "☐ Run 'uv run ruff format' to run the Ruff formatter.\n"
        )
E       AssertionError: assert '✔ Adding dep... formatter.\n' == '✔ Adding dep... formatter.\n'
E         
E           ✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
E           ☐ Install the dependency 'ruff'.
E           ✔ Adding Ruff config to 'pyproject.toml'.
E         + ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
E         - ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 
E         - 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
E           ✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
E           ☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
E           ☐ Run 'uv run ruff format' to run the Ruff formatter.

_          = ''
capfd      = <_pytest.capture.CaptureFixture object at 0x104ab36d0>
out        = "✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.\n☐ Install the dependency 'ruff'.\n✔ Adding Ruff c... run ruff check --fix' to run the Ruff linter with autofixes.\n☐ Run 'uv run ruff format' to run the Ruff formatter.\n"
self       = <tests.usethis._core.test_core_tool.TestRuff.TestAdd object at 0x10361f490>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_stdout_NetworkConn_ONLINE2')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_core/test_core_tool.py:3116: AssertionError
________ TestRemoveDepsFromGroup.test_multiple_deps[NetworkConn.ONLINE] ________

self = <tests.usethis.test_deps.TestRemoveDepsFromGroup object at 0x104870e80>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_multiple_deps_NetworkConn1')
capfd = <_pytest.capture.CaptureFixture object at 0x1049c5cf0>

    @pytest.mark.usefixtures("_vary_network_conn")
    def test_multiple_deps(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]):
        with change_cwd(uv_init_dir), PyprojectTOMLManager():
            # Arrange
            with usethis_config.set(quiet=True):
                add_deps_to_group(
                    [Dependency(name="flake8"), Dependency(name="black")], "qa"
                )
    
            # Act
            remove_deps_from_group(
                [Dependency(name="flake8"), Dependency(name="black")], "qa"
            )
    
            # Assert
            assert not get_deps_from_group("qa")
            out, err = capfd.readouterr()
            assert not err
>           assert (
                out
                == "✔ Removing dependencies 'flake8', 'black' from the 'qa' group in \n'pyproject.toml'.\n"
            )
E           assert "✔ Removing d...ject.toml'.\n" == "✔ Removing d...ject.toml'.\n"
E             
E             - ✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 
E             + ✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 'pyproject.toml'.
E             ?                                                                  +++++++++++++++++
E             - 'pyproject.toml'.

capfd      = <_pytest.capture.CaptureFixture object at 0x1049c5cf0>
err        = ''
out        = "✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 'pyproject.toml'.\n"
self       = <tests.usethis.test_deps.TestRemoveDepsFromGroup object at 0x104870e80>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_multiple_deps_NetworkConn1')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/test_deps.py:683: AssertionError
______ TestCoverage.TestAdd.test_pytest_integration[NetworkConn.OFFLINE] _______

self = <tests.usethis._core.test_core_tool.TestCoverage.TestAdd object at 0x10320e350>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_pytest_integration_Networ1')
capfd = <_pytest.capture.CaptureFixture object at 0x10452e110>

    @pytest.mark.usefixtures("_vary_network_conn")
    def test_pytest_integration(
        self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
    ):
        with change_cwd(uv_init_dir), files_manager():
            # Arrange
            with usethis_config.set(quiet=True):
                use_pytest()
    
            # Act
            use_coverage_py()
    
            # Assert
            assert Dependency(
                name="coverage", extras=frozenset({"toml"})
            ) in get_deps_from_group("test")
            out, err = capfd.readouterr()
            assert not err
>           assert out == (
                "✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in \n'pyproject.toml'.\n"
                "☐ Install the dependencies 'coverage', 'pytest-cov'.\n"
                "✔ Adding Coverage.py config to 'pyproject.toml'.\n"
                "☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
            )
E           AssertionError: assert '✔ Adding dep...overage.py.\n' == '✔ Adding dep...overage.py.\n'
E             
E             - ✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 
E             + ✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 'pyproject.toml'.
E             ?                                                                       +++++++++++++++++
E             - 'pyproject.toml'.
E               ☐ Install the dependencies 'coverage', 'pytest-cov'.
E               ✔ Adding Coverage.py config to 'pyproject.toml'.
E               ☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.

capfd      = <_pytest.capture.CaptureFixture object at 0x10452e110>
err        = ''
out        = "✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 'pyproject.toml'.\n☐ Install the dependencies '....\n✔ Adding Coverage.py config to 'pyproject.toml'.\n☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
self       = <tests.usethis._core.test_core_tool.TestCoverage.TestAdd object at 0x10320e350>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_pytest_integration_Networ1')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_core/test_core_tool.py:395: AssertionError
______ TestPytest.TestAdd.test_coverage_integration[NetworkConn.OFFLINE] _______

self = <tests.usethis._core.test_core_tool.TestPytest.TestAdd object at 0x103ef3970>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_coverage_integration_Netw1')
capfd = <_pytest.capture.CaptureFixture object at 0x103f2eb00>

    @pytest.mark.usefixtures("_vary_network_conn")
    def test_coverage_integration(
        self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
    ):
        with change_cwd(uv_init_dir), files_manager():
            # Arrange
            with usethis_config.set(quiet=True):
                use_coverage_py()
    
            # Act
            use_pytest()
    
        # Assert
        out, _ = capfd.readouterr()
>       assert out == (
            "✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in \n'pyproject.toml'.\n"
            "☐ Install the dependencies 'pytest', 'pytest-cov'.\n"
            "✔ Adding pytest config to 'pyproject.toml'.\n"
            "✔ Creating '/tests'.\n"
            "✔ Writing '/tests/conftest.py'.\n"
            "☐ Add test files to the '/tests' directory with the format 'test_*.py'.\n"
            "☐ Add test functions with the format 'test_*()'.\n"
            "☐ Run 'uv run pytest' to run the tests.\n"
            "☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
        )
E       AssertionError: assert '✔ Adding dep...overage.py.\n' == '✔ Adding dep...overage.py.\n'
E         
E         - ✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 
E         + ✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 'pyproject.toml'.
E         ?                                                                     +++++++++++++++++
E         - 'pyproject.toml'.
E           ☐ Install the dependencies 'pytest', 'pytest-cov'.
E           ✔ Adding pytest config to 'pyproject.toml'.
E           ✔ Creating '/tests'.
E           ✔ Writing '/tests/conftest.py'.
E           ☐ Add test files to the '/tests' directory with the format 'test_*.py'.
E           ☐ Add test functions with the format 'test_*()'.
E           ☐ Run 'uv run pytest' to run the tests.
E           ☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.

_          = ''
capfd      = <_pytest.capture.CaptureFixture object at 0x103f2eb00>
out        = "✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 'pyproject.toml'.\n☐ Install the dependencies 'py...test_*()'.\n☐ Run 'uv run pytest' to run the tests.\n☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.\n"
self       = <tests.usethis._core.test_core_tool.TestPytest.TestAdd object at 0x103ef3970>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_coverage_integration_Netw1')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_core/test_core_tool.py:2520: AssertionError
______________ TestRuff.TestAdd.test_stdout[NetworkConn.OFFLINE] _______________

self = <tests.usethis._core.test_core_tool.TestRuff.TestAdd object at 0x10361f310>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_stdout_NetworkConn_OFFLIN2')
capfd = <_pytest.capture.CaptureFixture object at 0x10506eb30>

    @pytest.mark.usefixtures("_vary_network_conn")
    def test_stdout(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]):
        # Act
        with change_cwd(uv_init_dir), files_manager():
            use_ruff()
    
        # Assert
        out, _ = capfd.readouterr()
>       assert out == (
            "✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.\n"
            "☐ Install the dependency 'ruff'.\n"
            "✔ Adding Ruff config to 'pyproject.toml'.\n"
            "✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', \n'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.\n"
            "✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.\n"
            "☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.\n"
            "☐ Run 'uv run ruff format' to run the Ruff formatter.\n"
        )
E       AssertionError: assert '✔ Adding dep... formatter.\n' == '✔ Adding dep... formatter.\n'
E         
E           ✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
E           ☐ Install the dependency 'ruff'.
E           ✔ Adding Ruff config to 'pyproject.toml'.
E         + ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
E         - ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 
E         - 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
E           ✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
E           ☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
E           ☐ Run 'uv run ruff format' to run the Ruff formatter.

_          = ''
capfd      = <_pytest.capture.CaptureFixture object at 0x10506eb30>
out        = "✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.\n☐ Install the dependency 'ruff'.\n✔ Adding Ruff c... run ruff check --fix' to run the Ruff linter with autofixes.\n☐ Run 'uv run ruff format' to run the Ruff formatter.\n"
self       = <tests.usethis._core.test_core_tool.TestRuff.TestAdd object at 0x10361f310>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_stdout_NetworkConn_OFFLIN2')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_core/test_core_tool.py:3116: AssertionError
_______ TestRemoveDepsFromGroup.test_multiple_deps[NetworkConn.OFFLINE] ________

self = <tests.usethis.test_deps.TestRemoveDepsFromGroup object at 0x104872e30>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_multiple_deps_NetworkConn3')
capfd = <_pytest.capture.CaptureFixture object at 0x104b66110>

    @pytest.mark.usefixtures("_vary_network_conn")
    def test_multiple_deps(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]):
        with change_cwd(uv_init_dir), PyprojectTOMLManager():
            # Arrange
            with usethis_config.set(quiet=True):
                add_deps_to_group(
                    [Dependency(name="flake8"), Dependency(name="black")], "qa"
                )
    
            # Act
            remove_deps_from_group(
                [Dependency(name="flake8"), Dependency(name="black")], "qa"
            )
    
            # Assert
            assert not get_deps_from_group("qa")
            out, err = capfd.readouterr()
            assert not err
>           assert (
                out
                == "✔ Removing dependencies 'flake8', 'black' from the 'qa' group in \n'pyproject.toml'.\n"
            )
E           assert "✔ Removing d...ject.toml'.\n" == "✔ Removing d...ject.toml'.\n"
E             
E             - ✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 
E             + ✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 'pyproject.toml'.
E             ?                                                                  +++++++++++++++++
E             - 'pyproject.toml'.

capfd      = <_pytest.capture.CaptureFixture object at 0x104b66110>
err        = ''
out        = "✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 'pyproject.toml'.\n"
self       = <tests.usethis.test_deps.TestRemoveDepsFromGroup object at 0x104872e30>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_multiple_deps_NetworkConn3')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/test_deps.py:683: AssertionError
_______________ TestCoverage.TestRemove.test_pytest_integration ________________

self = <tests.usethis._core.test_core_tool.TestCoverage.TestRemove object at 0x103f8b760>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_pytest_integration0')
capfd = <_pytest.capture.CaptureFixture object at 0x1050c54e0>

    def test_pytest_integration(
        self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
    ):
        with change_cwd(uv_init_dir), files_manager():
            # Arrange
            with usethis_config.set(quiet=True):
                use_pytest()
                use_coverage_py()
    
            # Act
            use_coverage_py(remove=True)
    
            # Assert
            assert get_deps_from_group("test") == [Dependency(name="pytest")]
            out, err = capfd.readouterr()
            assert not err
>           assert out == (
                "✔ Removing Coverage.py config from 'pyproject.toml'.\n"
                "✔ Removing dependencies 'coverage', 'pytest-cov' from the 'test' group in \n'pyproject.toml'.\n"
            )
E           assert "✔ Removing C...ject.toml'.\n" == "✔ Removing C...ject.toml'.\n"
E             
E               ✔ Removing Coverage.py config from 'pyproject.toml'.
E             - ✔ Removing dependencies 'coverage', 'pytest-cov' from the 'test' group in 
E             + ✔ Removing dependencies 'coverage', 'pytest-cov' from the 'test' group in 'pyproject.toml'.
E             ?                                                                           +++++++++++++++++
E             - 'pyproject.toml'.

capfd      = <_pytest.capture.CaptureFixture object at 0x1050c54e0>
err        = ''
out        = "✔ Removing Coverage.py config from 'pyproject.toml'.\n✔ Removing dependencies 'coverage', 'pytest-cov' from the 'test' group in 'pyproject.toml'.\n"
self       = <tests.usethis._core.test_core_tool.TestCoverage.TestRemove object at 0x103f8b760>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_pytest_integration0')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_core/test_core_tool.py:538: AssertionError
_______________ TestPytest.TestRemove.test_coverage_integration ________________

self = <tests.usethis._core.test_core_tool.TestPytest.TestRemove object at 0x10361ea70>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_coverage_integration0')
capfd = <_pytest.capture.CaptureFixture object at 0x104ab11b0>

    def test_coverage_integration(
        self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
    ):
        with change_cwd(uv_init_dir), files_manager():
            # Arrange
            with usethis_config.set(quiet=True):
                use_coverage_py()
                use_pytest()
    
            # Act
            use_pytest(remove=True)
    
        # Assert
        out, _ = capfd.readouterr()
>       assert out == (
            "✔ Removing pytest config from 'pyproject.toml'.\n"
            "✔ Removing dependencies 'pytest', 'pytest-cov' from the 'test' group in \n'pyproject.toml'.\n"
            "✔ Removing '/tests'.\n"
            "☐ Run 'uv run coverage help' to see available Coverage.py commands.\n"
        )
E       AssertionError: assert '✔ Removing p...y commands.\n' == '✔ Removing p...y commands.\n'
E         
E           ✔ Removing pytest config from 'pyproject.toml'.
E         - ✔ Removing dependencies 'pytest', 'pytest-cov' from the 'test' group in 
E         + ✔ Removing dependencies 'pytest', 'pytest-cov' from the 'test' group in 'pyproject.toml'.
E         ?                                                                         +++++++++++++++++
E         - 'pyproject.toml'.
E           ✔ Removing '/tests'.
E           ☐ Run 'uv run coverage help' to see available Coverage.py commands.

_          = ''
capfd      = <_pytest.capture.CaptureFixture object at 0x104ab11b0>
out        = "✔ Removing pytest config from 'pyproject.toml'.\n✔ Removing dependencies 'pytest', 'pytest-cov' from the 'test' group in 'pyproject.toml'.\n✔ Removing '/tests'.\n☐ Run 'uv run coverage help' to see available Coverage.py commands.\n"
self       = <tests.usethis._core.test_core_tool.TestPytest.TestRemove object at 0x10361ea70>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_coverage_integration0')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_core/test_core_tool.py:2840: AssertionError
____________________ TestRuff.TestAdd.test_only_add_linter _____________________

self = <tests.usethis._core.test_core_tool.TestRuff.TestAdd object at 0x1014e1450>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_only_add_linter0')
capfd = <_pytest.capture.CaptureFixture object at 0x1042c7cd0>

    def test_only_add_linter(
        self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
    ):
        # Act
        with change_cwd(uv_init_dir), files_manager():
            use_ruff(linter=True, formatter=False)
    
            # Assert
            assert not PyprojectTOMLManager().__contains__(
                ["tool", "ruff", "format"]
            )
    
        out, _ = capfd.readouterr()
>       assert out == (
            "✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.\n"
            "☐ Install the dependency 'ruff'.\n"
            "✔ Adding Ruff config to 'pyproject.toml'.\n"
            "✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', \n'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.\n"
            "✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.\n"
            "☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.\n"
        )
E       AssertionError: assert '✔ Adding dep... autofixes.\n' == '✔ Adding dep... autofixes.\n'
E         
E           ✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
E           ☐ Install the dependency 'ruff'.
E           ✔ Adding Ruff config to 'pyproject.toml'.
E         + ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
E         - ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 
E         - 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
E           ✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
E           ☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.

_          = ''
capfd      = <_pytest.capture.CaptureFixture object at 0x1042c7cd0>
out        = "✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.\n☐ Install the dependency 'ruff'.\n✔ Adding Ruff c...les 'PLR2004', 'SIM108' in 'pyproject.toml'.\n☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.\n"
self       = <tests.usethis._core.test_core_tool.TestRuff.TestAdd object at 0x1014e1450>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_only_add_linter0')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_core/test_core_tool.py:3249: AssertionError
_ TestPyprojectTOMLTool.TestRemoveManagedFiles.test_extra_warning_when_config_exists _

self = <tests.usethis._tool.impl.base.test_pyproject_toml.TestPyprojectTOMLTool.TestRemoveManagedFiles object at 0x10422bfa0>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_extra_warning_when_config0')
capfd = <_pytest.capture.CaptureFixture object at 0x1052e7040>

            def test_extra_warning_when_config_exists(
                self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
            ):
                # Arrange
                (uv_init_dir / "pyproject.toml").write_text(
                    """\
    [tool.ruff.lint]
    select = ["E", "PT"]
    """
                )
    
                # Act
                with change_cwd(uv_init_dir), files_manager():
                    PyprojectTOMLTool().remove_managed_files()
    
                    out, err = capfd.readouterr()
                    assert not err
>                   assert out == (
                        "☐ Check that important config in 'pyproject.toml' is not lost.\n"
                        "☐ The Ruff tool was using 'pyproject.toml' for config, but that file is being \n"
                        "removed. You will need to re-configure it.\n"
                        "✔ Removing 'pyproject.toml'.\n"
                    )
E                   assert "☐ Check that...ject.toml'.\n" == "☐ Check that...ject.toml'.\n"
E                     
E                       ☐ Check that important config in 'pyproject.toml' is not lost.
E                     - ☐ The Ruff tool was using 'pyproject.toml' for config, but that file is being 
E                     + ☐ The Ruff tool was using 'pyproject.toml' for config, but that file is being removed. You will need to re-configure it.
E                     ?                                                                               ++++++++++++++++++++++++++++++++++++++++++
E                     - removed. You will need to re-configure it.
E                       ✔ Removing 'pyproject.toml'.

capfd      = <_pytest.capture.CaptureFixture object at 0x1052e7040>
err        = ''
out        = "☐ Check that important config in 'pyproject.toml' is not lost.\n☐ The Ruff tool was using 'pyproject.toml' for config, but that file is being removed. You will need to re-configure it.\n✔ Removing 'pyproject.toml'.\n"
self       = <tests.usethis._tool.impl.base.test_pyproject_toml.TestPyprojectTOMLTool.TestRemoveManagedFiles object at 0x10422bfa0>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_extra_warning_when_config0')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_tool/impl/base/test_pyproject_toml.py:51: AssertionError
__________________________ TestPyprojectTOML.test_how __________________________

self = <tests.usethis._ui.interface.test_tool.TestPyprojectTOML object at 0x104002ce0>
tmp_path = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_how5')

        def test_how(self, tmp_path: Path):
            # Act
            runner = CliRunner()
            with change_cwd(tmp_path):
                result = runner.invoke_safe(app, ["pyproject.toml", "--how"])
    
            # Assert
            assert result.exit_code == 0, result.output
>           assert (
                result.output
                == """\
    ☐ Populate 'pyproject.toml' with the project configuration.
    ℹ Learn more at
    https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
    """  # noqa: RUF001
            )
E           assert "☐ Populate '...oject-toml/\n" == "☐ Populate '...oject-toml/\n"
E             
E               ☐ Populate 'pyproject.toml' with the project configuration.
E             - ℹ Learn more at 
E             - https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
E             + ℹ Learn more at https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
E             ? ++++++++++++++++

result     = <Result okay>
runner     = <usethis._test.CliRunner object at 0x10532f8e0>
self       = <tests.usethis._ui.interface.test_tool.TestPyprojectTOML object at 0x104002ce0>
tmp_path   = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_how5')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_ui/interface/test_tool.py:344: AssertionError
_________________________ TestRuff.test_readme_example _________________________

self = <tests.usethis._ui.interface.test_tool.TestRuff object at 0x103f35db0>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_readme_example0')

        def test_readme_example(self, uv_init_dir: Path):
            """This example is used the README.md file.
    
            Note carefully! If this test is updated, the README.md file must be
            updated too.
            """
            # Act
            runner = CliRunner()
            with change_cwd(uv_init_dir):
                result = runner.invoke_safe(app, ["ruff"])
    
            # Assert
            assert result.exit_code == 0, result.output
>           assert (
                result.output
                # ###################################
                # See docstring!
                # ###################################
                == """\
    ✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
    ✔ Adding Ruff config to 'pyproject.toml'.
    ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I',
    'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
    ✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
    ☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
    ☐ Run 'uv run ruff format' to run the Ruff formatter.
    """
            )
E           AssertionError: assert '✔ Adding dep... formatter.\n' == '✔ Adding dep... formatter.\n'
E             
E               ✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
E               ✔ Adding Ruff config to 'pyproject.toml'.
E             + ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
E             - ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 
E             - 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
E               ✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
E               ☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
E               ☐ Run 'uv run ruff format' to run the Ruff formatter.

result     = <Result okay>
runner     = <usethis._test.CliRunner object at 0x1053595d0>
self       = <tests.usethis._ui.interface.test_tool.TestRuff object at 0x103f35db0>
uv_init_dir = PosixPath('/private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/pytest-of-runner/pytest-0/test_readme_example0')

/Users/runner/work/usethis-python/usethis-python/tests/usethis/_ui/interface/test_tool.py:506: AssertionError
- generated Markdown report: /private/var/folders/tb/y368xp_x10s3ty1b_mtl5mxr0000gn/T/tmp.8lm4wwRu1D -
=========================== short test summary info ============================
SKIPPED [14] tests/usethis/test_fallback.py:56: Avoid flaky pipelines by testing version bumps manually
SKIPPED [1] tests/usethis/_tool/test_base.py:633: Multiple hooks in one repo not supported yet.
SKIPPED [1] tests/usethis/_tool/test_base.py:773: Multiple hooks in one repo not supported yet
SKIPPED [1] tests/usethis/_tool/test_base.py:810: Multiple hooks in one repo not supported yet
FAILED tests/usethis/_core/test_core_tool.py::TestCoverage::TestAdd::test_pytest_integration[NetworkConn.ONLINE] - AssertionError: assert '✔ Adding dep...overage.py.\n' == '✔ Adding dep...overage.py.\n'
  
  - ✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 
  + ✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 'pyproject.toml'.
  ?                                                                       +++++++++++++++++
  - 'pyproject.toml'.
    ☐ Install the dependencies 'coverage', 'pytest-cov'.
    ✔ Adding Coverage.py config to 'pyproject.toml'.
    ☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.
FAILED tests/usethis/_core/test_core_tool.py::TestPytest::TestAdd::test_coverage_integration[NetworkConn.ONLINE] - AssertionError: assert '✔ Adding dep...overage.py.\n' == '✔ Adding dep...overage.py.\n'
  
  - ✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 
  + ✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 'pyproject.toml'.
  ?                                                                     +++++++++++++++++
  - 'pyproject.toml'.
    ☐ Install the dependencies 'pytest', 'pytest-cov'.
    ✔ Adding pytest config to 'pyproject.toml'.
    ✔ Creating '/tests'.
    ✔ Writing '/tests/conftest.py'.
    ☐ Add test files to the '/tests' directory with the format 'test_*.py'.
    ☐ Add test functions with the format 'test_*()'.
    ☐ Run 'uv run pytest' to run the tests.
    ☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.
FAILED tests/usethis/_core/test_core_tool.py::TestRuff::TestAdd::test_stdout[NetworkConn.ONLINE] - AssertionError: assert '✔ Adding dep... formatter.\n' == '✔ Adding dep... formatter.\n'
  
    ✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
    ☐ Install the dependency 'ruff'.
    ✔ Adding Ruff config to 'pyproject.toml'.
  + ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
  - ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 
  - 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
    ✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
    ☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
    ☐ Run 'uv run ruff format' to run the Ruff formatter.
FAILED tests/usethis/test_deps.py::TestRemoveDepsFromGroup::test_multiple_deps[NetworkConn.ONLINE] - assert "✔ Removing d...ject.toml'.\n" == "✔ Removing d...ject.toml'.\n"
  
  - ✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 
  + ✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 'pyproject.toml'.
  ?                                                                  +++++++++++++++++
  - 'pyproject.toml'.
FAILED tests/usethis/_core/test_core_tool.py::TestCoverage::TestAdd::test_pytest_integration[NetworkConn.OFFLINE] - AssertionError: assert '✔ Adding dep...overage.py.\n' == '✔ Adding dep...overage.py.\n'
  
  - ✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 
  + ✔ Adding dependencies 'coverage', 'pytest-cov' to the 'test' group in 'pyproject.toml'.
  ?                                                                       +++++++++++++++++
  - 'pyproject.toml'.
    ☐ Install the dependencies 'coverage', 'pytest-cov'.
    ✔ Adding Coverage.py config to 'pyproject.toml'.
    ☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.
FAILED tests/usethis/_core/test_core_tool.py::TestPytest::TestAdd::test_coverage_integration[NetworkConn.OFFLINE] - AssertionError: assert '✔ Adding dep...overage.py.\n' == '✔ Adding dep...overage.py.\n'
  
  - ✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 
  + ✔ Adding dependencies 'pytest', 'pytest-cov' to the 'test' group in 'pyproject.toml'.
  ?                                                                     +++++++++++++++++
  - 'pyproject.toml'.
    ☐ Install the dependencies 'pytest', 'pytest-cov'.
    ✔ Adding pytest config to 'pyproject.toml'.
    ✔ Creating '/tests'.
    ✔ Writing '/tests/conftest.py'.
    ☐ Add test files to the '/tests' directory with the format 'test_*.py'.
    ☐ Add test functions with the format 'test_*()'.
    ☐ Run 'uv run pytest' to run the tests.
    ☐ Run 'uv run pytest --cov' to run your tests with Coverage.py.
FAILED tests/usethis/_core/test_core_tool.py::TestRuff::TestAdd::test_stdout[NetworkConn.OFFLINE] - AssertionError: assert '✔ Adding dep... formatter.\n' == '✔ Adding dep... formatter.\n'
  
    ✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
    ☐ Install the dependency 'ruff'.
    ✔ Adding Ruff config to 'pyproject.toml'.
  + ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
  - ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 
  - 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
    ✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
    ☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
    ☐ Run 'uv run ruff format' to run the Ruff formatter.
FAILED tests/usethis/test_deps.py::TestRemoveDepsFromGroup::test_multiple_deps[NetworkConn.OFFLINE] - assert "✔ Removing d...ject.toml'.\n" == "✔ Removing d...ject.toml'.\n"
  
  - ✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 
  + ✔ Removing dependencies 'flake8', 'black' from the 'qa' group in 'pyproject.toml'.
  ?                                                                  +++++++++++++++++
  - 'pyproject.toml'.
FAILED tests/usethis/_core/test_core_tool.py::TestCoverage::TestRemove::test_pytest_integration - assert "✔ Removing C...ject.toml'.\n" == "✔ Removing C...ject.toml'.\n"
  
    ✔ Removing Coverage.py config from 'pyproject.toml'.
  - ✔ Removing dependencies 'coverage', 'pytest-cov' from the 'test' group in 
  + ✔ Removing dependencies 'coverage', 'pytest-cov' from the 'test' group in 'pyproject.toml'.
  ?                                                                           +++++++++++++++++
  - 'pyproject.toml'.
FAILED tests/usethis/_core/test_core_tool.py::TestPytest::TestRemove::test_coverage_integration - AssertionError: assert '✔ Removing p...y commands.\n' == '✔ Removing p...y commands.\n'
  
    ✔ Removing pytest config from 'pyproject.toml'.
  - ✔ Removing dependencies 'pytest', 'pytest-cov' from the 'test' group in 
  + ✔ Removing dependencies 'pytest', 'pytest-cov' from the 'test' group in 'pyproject.toml'.
  ?                                                                         +++++++++++++++++
  - 'pyproject.toml'.
    ✔ Removing '/tests'.
    ☐ Run 'uv run coverage help' to see available Coverage.py commands.
FAILED tests/usethis/_core/test_core_tool.py::TestRuff::TestAdd::test_only_add_linter - AssertionError: assert '✔ Adding dep... autofixes.\n' == '✔ Adding dep... autofixes.\n'
  
    ✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
    ☐ Install the dependency 'ruff'.
    ✔ Adding Ruff config to 'pyproject.toml'.
  + ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
  - ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 
  - 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
    ✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
    ☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
FAILED tests/usethis/_tool/impl/base/test_pyproject_toml.py::TestPyprojectTOMLTool::TestRemoveManagedFiles::test_extra_warning_when_config_exists - assert "☐ Check that...ject.toml'.\n" == "☐ Check that...ject.toml'.\n"
  
    ☐ Check that important config in 'pyproject.toml' is not lost.
  - ☐ The Ruff tool was using 'pyproject.toml' for config, but that file is being 
  + ☐ The Ruff tool was using 'pyproject.toml' for config, but that file is being removed. You will need to re-configure it.
  ?                                                                               ++++++++++++++++++++++++++++++++++++++++++
  - removed. You will need to re-configure it.
    ✔ Removing 'pyproject.toml'.
FAILED tests/usethis/_ui/interface/test_tool.py::TestPyprojectTOML::test_how - assert "☐ Populate '...oject-toml/\n" == "☐ Populate '...oject-toml/\n"
  
    ☐ Populate 'pyproject.toml' with the project configuration.
  - ℹ Learn more at 
  - https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
  + ℹ Learn more at https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
  ? ++++++++++++++++
FAILED tests/usethis/_ui/interface/test_tool.py::TestRuff::test_readme_example - AssertionError: assert '✔ Adding dep... formatter.\n' == '✔ Adding dep... formatter.\n'
  
    ✔ Adding dependency 'ruff' to the 'dev' group in 'pyproject.toml'.
    ✔ Adding Ruff config to 'pyproject.toml'.
  + ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
  - ✔ Selecting Ruff rules 'A', 'C4', 'E4', 'E7', 'E9', 'F', 'FLY', 'FURB', 'I', 
  - 'PLE', 'PLR', 'RUF', 'SIM', 'UP' in 'pyproject.toml'.
    ✔ Ignoring Ruff rules 'PLR2004', 'SIM108' in 'pyproject.toml'.
    ☐ Run 'uv run ruff check --fix' to run the Ruff linter with autofixes.
    ☐ Run 'uv run ruff format' to run the Ruff formatter.
=========== 14 failed, 1536 passed, 17 skipped in 147.03s (0:02:27) ============

Update test assertions in test_core_tool.py, test_deps.py,
test_pyproject_toml.py, and test_tool.py to expect unwrapped output
now that all console print functions use soft_wrap=True.

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/d4c365e2-612d-4c4d-86ad-7b5a4c95ed87

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot please fix failing tests

Details

...

Fixed in c1a3c0b. There were 10 additional tests across 4 files that had hard-wrapped output expectations embedded in their assertions (e.g., embedded \n in the middle of dependency/rule messages). Updated them to expect the unwrapped output now that all console print functions use soft_wrap=True.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@nathanjmcdougall nathanjmcdougall merged commit d0c73b7 into main Mar 31, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/disable-hard-wrapping-all-commands branch March 31, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable hard-wrapping for all commands

2 participants