Skip to content

Commit b19daba

Browse files
committed
Simplify test
1 parent 329b76e commit b19daba

2 files changed

Lines changed: 2 additions & 42 deletions

File tree

src/vws/vws.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import base64
66
import io
77
import json
8-
from enum import Enum
98
from time import sleep
109
from typing import Dict, List, Optional, Union
1110
from urllib.parse import urljoin

tests/test_exceptions/test_unknown_target.py

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,18 @@
33
be given.
44
"""
55

6-
from typing import Any, Callable, Dict, Union
7-
86
import pytest
9-
from _pytest.fixtures import SubRequest
107
from requests import codes
118

129
from vws import VWS
1310
from vws.exceptions import UnknownTarget
1411

1512

16-
@pytest.fixture()
17-
def _delete_target(client: VWS) -> Callable[[str], None]:
18-
return client.delete_target
19-
20-
21-
@pytest.fixture()
22-
def _get_target_record(client: VWS,
23-
) -> Callable[[str], Dict[str, Union[str, int]]]:
24-
return client.get_target_record
25-
26-
27-
@pytest.fixture()
28-
def _wait_for_target_processed(client: VWS) -> Any:
29-
return client.wait_for_target_processed
30-
31-
32-
@pytest.fixture()
33-
def _get_target_summary_report(
34-
client: VWS,
35-
) -> Callable[[str], Dict[str, Union[str, int]]]:
36-
return client.get_target_summary_report
37-
38-
39-
@pytest.mark.parametrize(
40-
'fixture',
41-
[
42-
'_delete_target',
43-
'_get_target_record',
44-
'_wait_for_target_processed',
45-
'_get_target_summary_report',
46-
],
47-
)
48-
def test_invalid_given_id(
49-
fixture: Callable[[str], None],
50-
request: SubRequest,
51-
) -> None:
13+
def test_invalid_given_id(client: VWS) -> None:
5214
"""
5315
Giving an invalid ID to a helper which requires a target ID to be given
5416
causes an ``UnknownTarget`` exception to be raised.
5517
"""
56-
func = request.getfixturevalue(fixture)
5718
with pytest.raises(UnknownTarget) as exc:
58-
func(target_id='x')
19+
client.delete_target(target_id='x')
5920
assert exc.value.response.status_code == codes.NOT_FOUND

0 commit comments

Comments
 (0)