def test_connection_flag(self, project):
        """Testing that the --connection flag works as expected, including that output is not lost"""
        _, out = run_dbt_and_capture(["debug", "--connection"])
        assert "Skipping steps before connection verification" in out

        _, out = run_dbt_and_capture(
            ["debug", "--connection", "--target", "NONE"], expect_pass=False
        )
        assert "1 check failed" in out
        assert "The profile 'test' does not have a target named 'NONE'." in out

        _, out = run_dbt_and_capture(
            ["debug", "--connection", "--profiles-dir", "NONE"], expect_pass=False
        )
        assert "Using profiles dir at NONE"
        assert "1 check failed" in out
        assert "dbt looked for a profiles.yml file in NONE" in out
Testing that the --connection flag works as expected, including that output is not lost
tests/functional/adapter/dbt_debug/test_dbt_debug.py