From 3e0f8ea05810d332a53d7495f976fef22136b890 Mon Sep 17 00:00:00 2001 From: evilchili Date: Tue, 26 Mar 2024 00:07:44 -0700 Subject: [PATCH] adding pytest/pytest-cov support to init --- src/poetry_slam/cli.py | 5 ++++- src/poetry_slam/defaults.toml | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/poetry_slam/cli.py b/src/poetry_slam/cli.py index a6dc7ca..2e2c02e 100644 --- a/src/poetry_slam/cli.py +++ b/src/poetry_slam/cli.py @@ -46,7 +46,7 @@ def init(): logger.debug(f"Checking for modifications to {target}") existing = target.read_text() if "### SLAM" in existing: - logging.info(f"Found what looks like poetry-slam modifications; stopping.") + logging.info("Found what looks like poetry-slam modifications; stopping.") print(f"Abort: It looks like poetry-slam has already modified {target}.") else: backup = Path(str(target) + ".slam-orig") @@ -59,6 +59,9 @@ def init(): logging.debug(f"Renamed {new} to {target}") print(f"Added poetry-slam defaults to {target}") + logging.debug("Adding test dependencies to dev group.") + app_state["build_tool"].run_with_poetry("add", "-G", "dev", "pytest", "pytest-cov") + @app.command() def format(): diff --git a/src/poetry_slam/defaults.toml b/src/poetry_slam/defaults.toml index dab33dd..2f5b060 100644 --- a/src/poetry_slam/defaults.toml +++ b/src/poetry_slam/defaults.toml @@ -18,5 +18,8 @@ ignore-init-module-imports = true # exclude __init__.py when removing unused remove-duplicate-keys = true # remove all duplicate keys in objects remove-unused-variables = true # remove unused variables +[tool.pytest.ini_options] +log_cli_level = "DEBUG" +addopts = "--cov=src/croaker/ --cov-report=term-missing" ### ENDSLAM