diff --git a/cookiecutter.json b/cookiecutter.json index 3693232..78decc7 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -43,7 +43,7 @@ "backend": { "__prompt__": "Choose a build backend", "hatch": "Hatchling (recommended for pure Python projects)", - "vcs": "Enable hatch version control (vcs)?" + "vcs": "Let hatch get the version from your version control system (Git/Mercurial/SVN)?" }, "mypy": "Use mypy and static types" } diff --git a/noxfile.py b/noxfile.py index 8abfae1..ac3b58d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -43,6 +43,7 @@ def run_template_generation(session): session.install("-e", ".[dev]", silent=False) session.run("pytest", "tests/template_tests") + @nox.session(name="project-tests") def run_project_tests(session): """Run the tests for testing template generation""" diff --git a/{{cookiecutter.project_name}}/noxfile.py b/{{cookiecutter.project_name}}/noxfile.py index 078445f..e2dab63 100644 --- a/{{cookiecutter.project_name}}/noxfile.py +++ b/{{cookiecutter.project_name}}/noxfile.py @@ -36,6 +36,7 @@ def build_docs(session: nox.Session) -> None: "build/html/", ) + @nox.session(name="generated-project-tests") def run_generated_project_tests(session): """Run the tests for testing units inside generated project""" @@ -43,6 +44,7 @@ def run_generated_project_tests(session): session.install("-e", ".[dev]", silent=False) session.run("pytest", "tests/generated_project_tests") + @nox.session(name="user-tests") def run_user_tests(session): """Run the tests for testing user written tests""" @@ -50,6 +52,7 @@ def run_user_tests(session): session.install("-e", ".[dev]", silent=False) session.run("pytest", "tests/user_tests") + @nox.session(name="coverage") def run_coverage(session): """Run the coverage tests and generate an XML report.""" @@ -57,6 +60,7 @@ def run_coverage(session): session.posargs.append("--cov-report=xml") run_user_tests(session) + @nox.session(name="dev") def set_dev(session): """Install pybamm-cookiecutter in editable mode""" diff --git a/{{cookiecutter.project_name}}/tests/generated_project_tests/test_entry_points.py b/{{cookiecutter.project_name}}/tests/generated_project_tests/test_entry_points.py index 1c95959..21068cf 100644 --- a/{{cookiecutter.project_name}}/tests/generated_project_tests/test_entry_points.py +++ b/{{cookiecutter.project_name}}/tests/generated_project_tests/test_entry_points.py @@ -26,7 +26,7 @@ def test_parameter_sets_entry_point_load(): sys.modules["Chen2020mod"] = chen_module spec.loader.exec_module(chen_module) parameters_from_file = chen_module.get_parameter_values() - assert parameters.keys() == parameters_from_file.keys(), f"The keys in the module and local input file are not the same, expected {parameters.keys} got {parameters_from_file.keys()}" + assert parameters.keys() == parameters_from_file.keys(), f"The keys in the module and local input file are not the same, expected {parameters.keys}, got {parameters_from_file.keys()}" def test_model_entry_points(): """Test if the models via entry points are loaded correctly.""" @@ -38,6 +38,7 @@ def test_model_entry_points(): assert models == entry_points, "Entry points missing either in pyproject.toml or in the input directory" + def test_model_entry_point_load(): """Testing if the model gets initialised and returned.""" # Loading parameter_sets through entry points