Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
addopts = --show-capture=all
addopts = --show-capture=all --ignore="{{cookiecutter.project_name}}"
9 changes: 7 additions & 2 deletions tests/integration_tests/test_robust_python_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ def test_demo_project_nox_pre_commit(robust_demo: Path) -> None:
assert result.returncode == 0


@pytest.mark.parametrize(argnames="robust_demo__add_rust_extension", argvalues=[True, False], indirect=True)
@pytest.mark.parametrize(argnames="robust_demo__is_setup", argvalues=[False], indirect=True)
@pytest.mark.parametrize(
argnames="robust_demo__add_rust_extension",
argvalues=[True, False],
indirect=True,
ids=["maturin", "python"]
)
@pytest.mark.parametrize(argnames="robust_demo__is_setup", argvalues=[False], indirect=True, ids=["no-setup"])
def test_demo_project_nox_pre_commit_with_install(robust_demo: Path) -> None:
command: list[str] = ["nox", "-s", "pre-commit", "--", "install"]
pre_commit_hook_path: Path = robust_demo / ".git" / "hooks" / "pre-commit"
Expand Down
44 changes: 29 additions & 15 deletions tests/unit_tests/test_github_workflows.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from functools import partial
from typing import Any

import pytest

from util import templates_matching
from tests.util import templates_matching


@pytest.mark.parametrize(
Expand All @@ -12,18 +11,33 @@
indirect=True,
ids=["no-setup"]
)
@pytest.mark.parametrize(
argnames="robust_demo__add_rust_extension",
argvalues=[False, True],
indirect=True,
ids=["base", "maturin"]
)
@pytest.mark.parametrize(
argnames="robust_file__path__relative",
argvalues=templates_matching(".github/workflows/*.yml"),
indirect=True,
ids=lambda path: path.stem
)
class TestWorkflow:
def test_workflow_basic_loading(self, robust_yaml: dict[str, Any]) -> None:
@pytest.mark.parametrize(
argnames="robust_demo__add_rust_extension",
argvalues=[False],
indirect=True,
ids=["base"]
)
@pytest.mark.parametrize(
argnames="robust_file__path__relative",
argvalues=templates_matching(".github/workflows/*[!rust].yml"),
indirect=True,
ids=lambda path: path.stem
)
def test_workflow_basic_loading_with_python(self, robust_yaml: dict[str, Any]) -> None:
assert robust_yaml

@pytest.mark.parametrize(
argnames="robust_demo__add_rust_extension",
argvalues=[True],
indirect=True,
ids=["maturin"]
)
@pytest.mark.parametrize(
argnames="robust_file__path__relative",
argvalues=templates_matching(".github/workflows/*.yml"),
indirect=True,
ids=lambda path: path.stem
)
def test_workflow_basic_loading_with_maturin(self, robust_yaml: dict[str, Any]) -> None:
assert robust_yaml
2 changes: 1 addition & 1 deletion tests/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Module containing utility functions used by tests."""
from pathlib import Path

from constants import COOKIECUTTER_FOLDER
from tests.constants import COOKIECUTTER_FOLDER


def templates_matching(pattern: str) -> list[Path]:
Expand Down