adding pytest/pytest-cov support to init

This commit is contained in:
evilchili 2024-03-26 00:07:44 -07:00
parent 13f62976aa
commit 3e0f8ea058
2 changed files with 7 additions and 1 deletions

View File

@ -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():

View File

@ -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