Skip to content

Commit cdbcd37

Browse files
committed
Rename the TestFilesCollection param helper
`pytest` checks to see if this class can be treated as a test class under default rules because its name started with `Test`. This results in warnings in test output, and can be trivially fixed by renaming the class. `...Param` is potentially a good naming scheme for these dataclasses in general (see also jazzband#2336). It connects to `parametrize` usage well.
1 parent 5f31d8a commit cdbcd37

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_cli_compile.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def pip_produces_absolute_paths():
5656

5757

5858
@dataclasses.dataclass
59-
class TestFilesCollection:
59+
class FileCollectionParam:
6060
"""
6161
A small data-builder for setting up files in a tmp dir.
6262
@@ -3949,14 +3949,14 @@ def test_stdout_should_not_be_read_when_stdin_is_not_a_plain_file(
39493949
@pytest.mark.parametrize(
39503950
"test_files_collection",
39513951
(
3952-
TestFilesCollection(
3952+
FileCollectionParam(
39533953
"relative_include",
39543954
{
39553955
"requirements2.in": "small-fake-a\n",
39563956
"requirements.in": "-r requirements2.in\n",
39573957
},
39583958
),
3959-
TestFilesCollection(
3959+
FileCollectionParam(
39603960
"absolute_include",
39613961
{
39623962
"requirements2.in": "small-fake-a\n",
@@ -4016,21 +4016,21 @@ def test_second_order_requirements_path_handling(
40164016
@pytest.mark.parametrize(
40174017
"test_files_collection",
40184018
(
4019-
TestFilesCollection(
4019+
FileCollectionParam(
40204020
"parent_dir",
40214021
{
40224022
"requirements2.in": "small-fake-a\n",
40234023
"subdir/requirements.in": "-r ../requirements2.in\n",
40244024
},
40254025
),
4026-
TestFilesCollection(
4026+
FileCollectionParam(
40274027
"subdir",
40284028
{
40294029
"requirements.in": "-r ./subdir/requirements2.in",
40304030
"subdir/requirements2.in": "small-fake-a\n",
40314031
},
40324032
),
4033-
TestFilesCollection(
4033+
FileCollectionParam(
40344034
"sibling_dir",
40354035
{
40364036
"subdir1/requirements.in": "-r ../subdir2/requirements2.in",
@@ -4103,7 +4103,7 @@ def test_second_order_requirements_can_be_in_parent_of_cwd(
41034103
Test handling of ``-r`` includes when the included requirements file is in the
41044104
parent of the current working directory.
41054105
"""
4106-
test_files_collection = TestFilesCollection(
4106+
test_files_collection = FileCollectionParam(
41074107
contents={
41084108
"subdir1/requirements.in": "-r ../requirements2.in\n",
41094109
"requirements2.in": "small-fake-a\n",

0 commit comments

Comments
 (0)