diff --git a/noxfile.py b/noxfile.py index 1438730f..f8f3b7e5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -243,11 +243,10 @@ def native(session: nox.Session, backend: str, vcs: bool) -> None: session.chdir(cookie) if backend == "hatch": - session.run(backend, "env", "create") + session.run(backend, "run", "test") else: session.run(backend, "install") - - session.run(backend, "run", "pytest") + session.run(backend, "run", "pytest") @nox.session() diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 34927eb6..7043a44e 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -253,10 +253,11 @@ version.path = "src/{{ cookiecutter.__project_slug }}/__init__.py" version.source = "vcs" build.hooks.vcs.version-file = "src/{{ cookiecutter.__project_slug }}/_version.py" {%- endif %} -envs.default.dependencies = [ - "pytest", - "pytest-cov", -] + +[tool.hatch.env.default] +features = ["test"] +scripts.test = "pytest {args}" + {%- elif cookiecutter.backend == "pdm" %} {%- if cookiecutter.vcs %}