kjaymiller/cookiecutter-relecloud

Unable to test new checks for imports

Open

#77 aperta il 10 ago 2023

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)CSS (5 fork)github user discovery
help wantedtests

Metriche repository

Star
 (7 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

in tests/test_cookie_cutter_generation. I have the following test that is not actually capturing the desired test.

@pytest.mark.skip(reason="unable to check with caplog but tested in functional test - issue #1")
def test_project_post_hook_triggers_warning_if_linters_not_installed(
    cookies_session, context, mocker, caplog
    ):
    """If ruff or black is not installed, the post hook should trigger a warning"""

    mocker.patch("hooks.post_gen_project.importlib.util.find_spec", return_value=None)

    with caplog.at_level("WARNING"):
        cookies_session.bake(extra_context=context)

Guida contributor