Skip to content

Commit 3cdfa6b

Browse files
chore: pre-commit autoupdate (#373)
* chore: pre-commit autoupdate updates: - [github.com/rbubley/mirrors-prettier: v3.4.2 → v3.5.3](rbubley/mirrors-prettier@v3.4.2...v3.5.3) - [github.com/astral-sh/ruff-pre-commit: v0.9.4 → v0.9.9](astral-sh/ruff-pre-commit@v0.9.4...v0.9.9) - [github.com/streetsidesoftware/cspell-cli: v8.17.2 → v8.17.3](streetsidesoftware/cspell-cli@v8.17.2...v8.17.3) - [github.com/jsh9/pydoclint: 0.6.0 → 0.6.2](jsh9/pydoclint@0.6.0...0.6.2) - [github.com/pre-commit/mirrors-mypy.git: v1.14.1 → v1.15.0](https://github.com/pre-commit/mirrors-mypy.git/compare/v1.14.1...v1.15.0) * Fix pydoclint failures * Fix pydoclint failures: some more * Fix fixtures --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: shatakshiiii <[email protected]>
1 parent efa310f commit 3cdfa6b

File tree

14 files changed

+207
-13
lines changed

14 files changed

+207
-13
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repos:
3232
)$
3333
3434
- repo: https://github.com/rbubley/mirrors-prettier
35-
rev: v3.4.2
35+
rev: v3.5.3
3636
hooks:
3737
- id: prettier
3838
always_run: true
@@ -52,7 +52,7 @@ repos:
5252
- id: tox-ini-fmt
5353

5454
- repo: https://github.com/astral-sh/ruff-pre-commit
55-
rev: v0.9.4
55+
rev: v0.9.9
5656
hooks:
5757
- id: ruff
5858
args:
@@ -63,13 +63,13 @@ repos:
6363
types_or: [python, pyi]
6464

6565
- repo: https://github.com/streetsidesoftware/cspell-cli
66-
rev: v8.17.2
66+
rev: v8.17.3
6767
hooks:
6868
- id: cspell
6969
name: Spell check with cspell
7070

7171
- repo: https://github.com/jsh9/pydoclint
72-
rev: "0.6.0"
72+
rev: "0.6.2"
7373
hooks:
7474
- id: pydoclint
7575
# This allows automatic reduction of the baseline file when needed.
@@ -88,7 +88,7 @@ repos:
8888
- pyyaml
8989

9090
- repo: https://github.com/pre-commit/mirrors-mypy.git
91-
rev: v1.14.1
91+
rev: v1.15.0
9292
hooks:
9393
- id: mypy
9494
additional_dependencies:

src/ansible_creator/resources/collection_project/tests/integration/test_integration.py.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def test_integration(molecule_scenario: MoleculeScenario) -> None:
1010

1111
Args:
1212
molecule_scenario: The molecule scenario object
13+
Raises:
14+
AssertionError: If the molecule scenario test does not return a zero exit code.
1315
"""
1416
proc = molecule_scenario.test()
1517
assert proc.returncode == 0

src/ansible_creator/resources/collection_project/tests/unit/test_basic.py.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22

33

44
def test_basic() -> None:
5-
"""Dummy unit test that always passes."""
5+
"""Dummy unit test that always passes.
6+
7+
Raises:
8+
AssertionError: If the assertion fails.
9+
"""
610
assert bool(1) is True

tests/fixtures/collection/testorg/testcol/tests/integration/test_integration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def test_integration(molecule_scenario: MoleculeScenario) -> None:
1010
1111
Args:
1212
molecule_scenario: The molecule scenario object
13+
Raises:
14+
AssertionError: If the molecule scenario test does not return a zero exit code.
1315
"""
1416
proc = molecule_scenario.test()
1517
assert proc.returncode == 0

tests/fixtures/collection/testorg/testcol/tests/unit/test_basic.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22

33

44
def test_basic() -> None:
5-
"""Dummy unit test that always passes."""
5+
"""Dummy unit test that always passes.
6+
7+
Raises:
8+
AssertionError: If the assertion fails.
9+
"""
610
assert bool(1) is True

tests/integration/test_init.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def test_run_help(cli: CliRunCallable) -> None:
2323
2424
Args:
2525
cli: cli_run function.
26+
27+
Raises:
28+
AssertionError: If the assertion fails.
2629
"""
2730
# Get the path to the current python interpreter
2831
result = cli(f"{CREATOR_BIN} --help")
@@ -41,6 +44,9 @@ def test_run_no_subcommand(cli: CliRunCallable) -> None:
4144
4245
Args:
4346
cli: cli_run function.
47+
48+
Raises:
49+
AssertionError: If the assertion fails.
4450
"""
4551
result = cli(str(CREATOR_BIN))
4652
assert result.returncode != 0
@@ -52,6 +58,9 @@ def test_run_init_no_input(cli: CliRunCallable) -> None:
5258
5359
Args:
5460
cli: cli_run function.
61+
62+
Raises:
63+
AssertionError: If the assertion fails.
5564
"""
5665
result = cli(f"{CREATOR_BIN} init")
5766
assert result.returncode != 0
@@ -70,6 +79,9 @@ def test_run_deprecated_failure(command: str, cli: CliRunCallable) -> None:
7079
Args:
7180
command: Command to run.
7281
cli: cli_run function.
82+
83+
Raises:
84+
AssertionError: If the assertion fails.
7385
"""
7486
result = cli(f"{CREATOR_BIN} {command}")
7587
assert result.returncode != 0
@@ -95,6 +107,9 @@ def test_run_init_invalid_name(command: str, args: str, expected: str, cli: CliR
95107
args: Arguments to pass to the CLI.
96108
expected: Expected error message.
97109
cli: cli_run function.
110+
111+
Raises:
112+
AssertionError: If the assertion fails.
98113
"""
99114
result = cli(f"{CREATOR_BIN} init {command} {args}")
100115
assert result.returncode != 0
@@ -108,6 +123,9 @@ def test_run_init_basic(cli: CliRunCallable, tmp_path: Path) -> None:
108123
Args:
109124
cli: cli_run function.
110125
tmp_path: Temporary path.
126+
127+
Raises:
128+
AssertionError: If the assertion fails.
111129
"""
112130
final_dest = f"{tmp_path}/collections/ansible_collections"
113131
cli(f"mkdir -p {final_dest}")
@@ -149,6 +167,9 @@ def test_run_init_ee(cli: CliRunCallable, tmp_path: Path) -> None:
149167
Args:
150168
cli: cli_run function.
151169
tmp_path: Temporary path.
170+
171+
Raises:
172+
AssertionError: If the assertion fails.
152173
"""
153174
final_dest = f"{tmp_path}/ee_project"
154175
cli(f"mkdir -p {final_dest}")

tests/integration/test_lint.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def test_lint_collection(
4242
Args:
4343
cli: CLI callable.
4444
monkeypatch: Monkeypatch fixture.
45+
46+
Raises:
47+
AssertionError: If the assertion fails.
4548
"""
4649
project_path = FIXTURES_DIR / "collection"
4750
monkeypatch.chdir(project_path)
@@ -77,6 +80,9 @@ def test_lint_playbook_project(
7780
tmp_path: Temporary path.
7881
cli: CLI callable.
7982
monkeypatch: Monkeypatch fixture.
83+
84+
Raises:
85+
AssertionError: If the assertion fails.
8086
"""
8187
req_path = str(
8288
FIXTURES_DIR / "project" / "playbook_project" / "collections" / "requirements.yml",

tests/units/test_add.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# cspell: ignore dcmp, subdcmp
2+
# pylint: disable=C0302
23
"""Unit tests for ansible-creator add."""
34

45
from __future__ import annotations
@@ -122,6 +123,9 @@ def test_run_success_add_devfile(
122123
tmp_path: Temporary directory path.
123124
cli_args: Dictionary, partial Add class object.
124125
monkeypatch: Pytest monkeypatch fixture.
126+
127+
Raises:
128+
AssertionError: If the assertion fails.
125129
"""
126130
cli_args["resource_type"] = "devfile"
127131
add = Add(
@@ -196,6 +200,9 @@ def test_run_error_no_overwrite(
196200
capsys: Pytest fixture to capture stdout and stderr.
197201
tmp_path: Temporary directory path.
198202
cli_args: Dictionary, partial Add class object.
203+
204+
Raises:
205+
AssertionError: If the assertion fails.
199206
"""
200207
cli_args["resource_type"] = "devfile"
201208
add = Add(
@@ -248,6 +255,9 @@ def test_error_invalid_path(
248255
249256
Args:
250257
cli_args: Dictionary, partial Add class object.
258+
259+
Raises:
260+
AssertionError: If the assertion fails.
251261
"""
252262
cli_args["resource_type"] = "devfile"
253263
cli_args["path"] = "/invalid"
@@ -269,6 +279,9 @@ def test_error_invalid_collection_path(
269279
270280
Args:
271281
cli_args: Dictionary, partial Add class object.
282+
283+
Raises:
284+
AssertionError: If the assertion fails.
272285
"""
273286
cli_args["plugin_type"] = "lookup"
274287
add = Add(
@@ -297,6 +310,9 @@ def test_run_error_unsupported_resource_type(
297310
Args:
298311
cli_args: Dictionary, partial Add class object.
299312
monkeypatch: Pytest monkeypatch fixture.
313+
314+
Raises:
315+
AssertionError: If the assertion fails.
300316
"""
301317
cli_args["resource_type"] = "devfile"
302318
add = Add(
@@ -326,6 +342,9 @@ def test_run_success_add_devcontainer(
326342
tmp_path: Temporary directory path.
327343
cli_args: Dictionary, partial Add class object.
328344
monkeypatch: Pytest monkeypatch fixture.
345+
346+
Raises:
347+
AssertionError: If the assertion fails.
329348
"""
330349
# Set the resource_type to devcontainer
331350
cli_args["resource_type"] = "devcontainer"
@@ -393,6 +412,7 @@ def test_devcontainer_usability(
393412
cli_args: Dictionary, partial Add class object.
394413
395414
Raises:
415+
AssertionError: If the assertion fails.
396416
FileNotFoundError: If the 'npm' or 'docker' executable is not found in the PATH.
397417
"""
398418
# Set the resource_type to devcontainer
@@ -467,6 +487,9 @@ def test_run_success_add_plugin_filter(
467487
tmp_path: Temporary directory path.
468488
cli_args: Dictionary, partial Add class object.
469489
monkeypatch: Pytest monkeypatch fixture.
490+
491+
Raises:
492+
AssertionError: If the assertion fails.
470493
"""
471494
cli_args["plugin_type"] = "filter"
472495
add = Add(
@@ -544,6 +567,9 @@ def test_run_success_add_plugin_lookup(
544567
tmp_path: Temporary directory path.
545568
cli_args: Dictionary, partial Add class object.
546569
monkeypatch: Pytest monkeypatch fixture.
570+
571+
Raises:
572+
AssertionError: If the assertion fails.
547573
"""
548574
cli_args["plugin_type"] = "lookup"
549575
add = Add(
@@ -620,6 +646,9 @@ def test_run_success_add_plugin_action(
620646
tmp_path: Temporary directory path.
621647
cli_args: Dictionary, partial Add class object.
622648
monkeypatch: Pytest monkeypatch fixture.
649+
650+
Raises:
651+
AssertionError: If the assertion fails.
623652
"""
624653
cli_args["plugin_type"] = "action"
625654
add = Add(
@@ -690,6 +719,9 @@ def test_run_success_add_plugin_module(
690719
tmp_path: Temporary directory path.
691720
cli_args: Dictionary, partial Add class object.
692721
monkeypatch: Pytest monkeypatch fixture.
722+
723+
Raises:
724+
AssertionError: If the assertion fails.
693725
"""
694726
cli_args["plugin_type"] = "module"
695727
add = Add(
@@ -767,6 +799,9 @@ def test_run_error_plugin_no_overwrite(
767799
tmp_path: Temporary directory path.
768800
cli_args: Dictionary, partial Add class object.
769801
monkeypatch: Pytest monkeypatch fixture.
802+
803+
Raises:
804+
AssertionError: If the assertion fails.
770805
"""
771806
cli_args["plugin_type"] = "lookup"
772807
add = Add(
@@ -823,6 +858,9 @@ def test_run_error_unsupported_plugin_type(
823858
Args:
824859
cli_args: Dictionary, partial Add class object.
825860
monkeypatch: Pytest monkeypatch fixture.
861+
862+
Raises:
863+
AssertionError: If the assertion fails.
826864
"""
827865
add = Add(
828866
Config(**cli_args),
@@ -860,6 +898,9 @@ def test_run_success_add_execution_env(
860898
tmp_path: Temporary directory path.
861899
cli_args: Dictionary, partial Add class object.
862900
monkeypatch: Pytest monkeypatch fixture.
901+
902+
Raises:
903+
AssertionError: If the assertion fails.
863904
"""
864905
# Set the resource_type to execution-environment
865906
cli_args["resource_type"] = "execution-environment"
@@ -916,6 +957,9 @@ def test_update_galaxy_dependency(tmp_path: Path, cli_args: ConfigDict) -> None:
916957
Args:
917958
tmp_path: Temporary directory path.
918959
cli_args: Dictionary, partial Add class object.
960+
961+
Raises:
962+
AssertionError: If the assertion fails.
919963
"""
920964
galaxy_file = tmp_path / "galaxy.yml"
921965
initial_data: dict[str, Any]

tests/units/test_argparse_help.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111

1212
def test_custom_help_single() -> None:
13-
"""Test the custom help formatter with single."""
13+
"""Test the custom help formatter with single.
14+
15+
Raises:
16+
AssertionError: If the assertion fails.
17+
"""
1418
parser = argparse.ArgumentParser(formatter_class=CustomHelpFormatter)
1519
parser.add_argument("--foo", help="foo help")
1620
help_text = parser.format_help()
@@ -19,7 +23,11 @@ def test_custom_help_single() -> None:
1923

2024

2125
def test_custom_help_double() -> None:
22-
"""Test the custom help formatter with double."""
26+
"""Test the custom help formatter with double.
27+
28+
Raises:
29+
AssertionError: If the assertion fails.
30+
"""
2331
parser = argparse.ArgumentParser(formatter_class=CustomHelpFormatter)
2432
parser.add_argument("-f", "--foo", help="foo help")
2533
help_text = parser.format_help()

0 commit comments

Comments
 (0)