Skip to content

Commit c6b83cf

Browse files
committed
rename TestCase to resolve warning
1 parent f31643e commit c6b83cf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/unit/scrapy/pipelines/test_actor_dataset_push.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def pipeline() -> ActorDatasetPushPipeline:
3737

3838

3939
@dataclass(frozen=True)
40-
class TestCase:
40+
class ItemTestCase:
4141
item: Item
4242
item_dict: dict
4343
expected_exception: type[Exception] | None
@@ -46,17 +46,17 @@ class TestCase:
4646
@pytest.mark.parametrize(
4747
'tc',
4848
[
49-
TestCase(
49+
ItemTestCase(
5050
item=DummyItem(a='string', b=123, c=False),
5151
item_dict={'a': 'string', 'b': 123, 'c': False},
5252
expected_exception=None,
5353
),
54-
TestCase(
54+
ItemTestCase(
5555
item=TitleItem(url='https://example.com', title='Example'),
5656
item_dict={'url': 'https://example.com', 'title': 'Example'},
5757
expected_exception=None,
5858
),
59-
TestCase(
59+
ItemTestCase(
6060
item=None,
6161
item_dict={},
6262
expected_exception=TypeError,
@@ -68,7 +68,7 @@ async def test_process_item(
6868
monkeypatch: pytest.MonkeyPatch,
6969
pipeline: ActorDatasetPushPipeline,
7070
spider: Spider,
71-
tc: TestCase,
71+
tc: ItemTestCase,
7272
) -> None:
7373
dataset = []
7474

tests/unit/scrapy/utils/test_get_basic_auth_header.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
@dataclass(frozen=True)
11-
class TestCase:
11+
class ItemTestCase:
1212
username: str
1313
password: str
1414
expected_auth_header: bytes
@@ -17,11 +17,11 @@ class TestCase:
1717
@pytest.mark.parametrize(
1818
'tc',
1919
[
20-
TestCase('username', 'password', b'Basic dXNlcm5hbWU6cGFzc3dvcmQ='),
21-
TestCase('john_smith', 'secret_password_123', b'Basic am9obl9zbWl0aDpzZWNyZXRfcGFzc3dvcmRfMTIz'),
20+
ItemTestCase('username', 'password', b'Basic dXNlcm5hbWU6cGFzc3dvcmQ='),
21+
ItemTestCase('john_smith', 'secret_password_123', b'Basic am9obl9zbWl0aDpzZWNyZXRfcGFzc3dvcmRfMTIz'),
2222
],
2323
ids=['simple_username_password', 'complex_username_password'],
2424
)
25-
def test_basic_auth_header_generation(tc: TestCase) -> None:
25+
def test_basic_auth_header_generation(tc: ItemTestCase) -> None:
2626
auth_header = get_basic_auth_header(tc.username, tc.password)
2727
assert auth_header == tc.expected_auth_header

0 commit comments

Comments
 (0)