adding pytest/pytest-cov support to init
This commit is contained in:
parent
13f62976aa
commit
3e0f8ea058
|
@ -46,7 +46,7 @@ def init():
|
||||||
logger.debug(f"Checking for modifications to {target}")
|
logger.debug(f"Checking for modifications to {target}")
|
||||||
existing = target.read_text()
|
existing = target.read_text()
|
||||||
if "### SLAM" in existing:
|
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}.")
|
print(f"Abort: It looks like poetry-slam has already modified {target}.")
|
||||||
else:
|
else:
|
||||||
backup = Path(str(target) + ".slam-orig")
|
backup = Path(str(target) + ".slam-orig")
|
||||||
|
@ -59,6 +59,9 @@ def init():
|
||||||
logging.debug(f"Renamed {new} to {target}")
|
logging.debug(f"Renamed {new} to {target}")
|
||||||
print(f"Added poetry-slam defaults 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()
|
@app.command()
|
||||||
def format():
|
def format():
|
||||||
|
|
|
@ -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-duplicate-keys = true # remove all duplicate keys in objects
|
||||||
remove-unused-variables = true # remove unused variables
|
remove-unused-variables = true # remove unused variables
|
||||||
|
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
log_cli_level = "DEBUG"
|
||||||
|
addopts = "--cov=src/croaker/ --cov-report=term-missing"
|
||||||
|
|
||||||
### ENDSLAM
|
### ENDSLAM
|
||||||
|
|
Loading…
Reference in New Issue
Block a user