Skip to content

Commit 5b8d285

Browse files
Merge branch 'main' into create-pull-request/patch
2 parents b27a8ef + 600a402 commit 5b8d285

6 files changed

Lines changed: 5 additions & 13 deletions

File tree

.agents/skills/usethis-python-test/SKILL.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: General guidelines for writing tests in the usethis project, includ
44
compatibility: usethis, Python, pytest
55
license: MIT
66
metadata:
7-
version: "1.4"
7+
version: "1.5"
88
---
99

1010
# Python Test Guidelines
@@ -57,9 +57,11 @@ If a method is defined on `SomeClass` in `some_module.py`, its tests belong unde
5757

5858
Placing tests near the utility they exercise (rather than near the class they belong to) breaks the structural correspondence between source and test files, making tests harder to find and maintain.
5959

60-
### No docstrings on test classes or functions
60+
### No redundant docstrings on test classes or functions
6161

62-
Test classes and test functions should not have docstrings. The class and function names should be descriptive enough to communicate what is being tested.
62+
Avoid adding docstrings to test classes and test functions when the name alone is sufficient. For example, `"""Tests for validate_or_raise."""` on `TestValidateOrRaise` is redundant — the class name already communicates this.
63+
64+
However, a docstring is appropriate when it adds genuinely new information that the name does not convey, such as explaining the test strategy, describing a non-obvious constraint, or clarifying how the test output is validated.
6365

6466
## Using `files_manager` in tests
6567

tests/usethis/_core/test_core_tool.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,8 +2234,6 @@ def test_hooks_run_all_tools_empty_repo(self, uv_env_dir: Path):
22342234
)
22352235

22362236
class TestMigration:
2237-
"""Test migration of tools to/from pre-commit (issue #1020)."""
2238-
22392237
@pytest.mark.usefixtures("_vary_network_conn")
22402238
def test_deps_not_removed_when_migrating_to_pre_commit(self, uv_init_dir: Path):
22412239
"""Test that deps are NOT removed when migrating to pre-commit."""

tests/usethis/_file/yaml/test_yaml_io_.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,6 @@ def relative_path(self) -> Path:
11391139

11401140
class TestEditYaml:
11411141
class TestLiterals:
1142-
"""The list of literals is from ruamel/yaml/representer.py near the bottom."""
1143-
11441142
def test_none(self, tmp_path: Path):
11451143
# Arrange
11461144
path = tmp_path / "test.yaml"

tests/usethis/_integrations/pre_commit/test_hooks.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,6 @@ def test_aliases(self):
766766

767767

768768
class TestAddRepoPipeweld:
769-
"""Integration tests for pipeweld-based hook insertion."""
770-
771769
def test_insert_between_nondependent_and_postrequisite(self, tmp_path: Path):
772770
"""Insert a recognized hook between an unrecognized hook and a postrequisite."""
773771
with change_cwd(tmp_path), files_manager():

tests/usethis/_pipeweld/test_func.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ def test_nested_series(self):
174174
assert result.solution == series(series(parallel("A", "B")))
175175

176176
class TestDoubleNesting:
177-
"""A series of related tests building up to a complex case."""
178-
179177
def test_no_nesting(self):
180178
# Arrange
181179
adder = Adder(

tests/usethis/_tool/impl/base/test_deptry.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111

1212
class TestDeptryTool:
13-
"""Tests for DeptryTool."""
14-
1513
def test_get_pyproject_id_keys(self):
1614
"""Test that get_pyproject_id_keys returns the correct keys."""
1715
# Arrange

0 commit comments

Comments
 (0)