Skip to content

Commit e1250d8

Browse files
committed
Apply black formatting
1 parent e1acfda commit e1250d8

7 files changed

Lines changed: 18 additions & 47 deletions

File tree

docs/source/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
specifiers = SpecifierSet(specifiers=requires_python)
4343
(specifier,) = specifiers
4444
if specifier.operator != ">=":
45-
msg = (
46-
f"We only support '>=' for Requires-Python, got {specifier.operator}."
47-
)
45+
msg = f"We only support '>=' for Requires-Python, got {specifier.operator}."
4846
raise ValueError(msg)
4947
minimum_python_version = specifier.version
5048

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ universal = true
107107
# Code to match this is in ``conf.py``.
108108
version_scheme = "post-release"
109109

110+
[tool.uv.sources]
111+
docformatter = { git = "https://github.com/PyCQA/docformatter.git", branch = "master" }
112+
110113
[tool.ruff]
111114
line-length = 79
112115

src/vws/query.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ def query(
164164
if "Integer out of range" in response.text:
165165
raise MaxNumResultsOutOfRangeError(response=response)
166166

167-
if (
168-
response.status_code >= HTTPStatus.INTERNAL_SERVER_ERROR
169-
): # pragma: no cover
167+
if response.status_code >= HTTPStatus.INTERNAL_SERVER_ERROR: # pragma: no cover
170168
raise ServerError(response=response)
171169

172170
result_code = json.loads(s=response.text)["result_code"]

src/vws/vws.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,11 @@ def make_request(
195195
base_vws_url=self._base_vws_url,
196196
)
197197

198-
if (
199-
response.status_code == HTTPStatus.TOO_MANY_REQUESTS
200-
): # pragma: no cover
198+
if response.status_code == HTTPStatus.TOO_MANY_REQUESTS: # pragma: no cover
201199
# The Vuforia API returns a 429 response with no JSON body.
202200
raise TooManyRequestsError(response=response)
203201

204-
if (
205-
response.status_code >= HTTPStatus.INTERNAL_SERVER_ERROR
206-
): # pragma: no cover
202+
if response.status_code >= HTTPStatus.INTERNAL_SERVER_ERROR: # pragma: no cover
207203
raise ServerError(response=response)
208204

209205
result_code = json.loads(s=response.text)["result_code"]

tests/test_cloud_reco_exceptions.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ def test_image_too_large(
5757
with pytest.raises(expected_exception=RequestEntityTooLargeError) as exc:
5858
cloud_reco_client.query(image=png_too_large)
5959

60-
assert (
61-
exc.value.response.status_code == HTTPStatus.REQUEST_ENTITY_TOO_LARGE
62-
)
60+
assert exc.value.response.status_code == HTTPStatus.REQUEST_ENTITY_TOO_LARGE
6361

6462

6563
def test_cloudrecoexception_inheritance() -> None:
@@ -92,9 +90,7 @@ def test_authentication_failure(
9290
with MockVWS() as mock:
9391
mock.add_database(database=database)
9492

95-
with pytest.raises(
96-
expected_exception=AuthenticationFailureError
97-
) as exc:
93+
with pytest.raises(expected_exception=AuthenticationFailureError) as exc:
9894
cloud_reco_client.query(image=high_quality_image)
9995

10096
assert exc.value.response.status_code == HTTPStatus.UNAUTHORIZED

tests/test_vws.py

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,8 @@ def test_get_target_summary_report(
229229
assert report.active_flag == expected_report.active_flag
230230
assert report.tracking_rating == expected_report.tracking_rating
231231
assert report.total_recos == expected_report.total_recos
232-
assert (
233-
report.current_month_recos == expected_report.current_month_recos
234-
)
235-
assert (
236-
report.previous_month_recos == expected_report.previous_month_recos
237-
)
232+
assert report.current_month_recos == expected_report.current_month_recos
233+
assert report.previous_month_recos == expected_report.previous_month_recos
238234

239235
assert report == expected_report
240236

@@ -267,15 +263,11 @@ def test_get_target(vws_client: VWS) -> None:
267263
)
268264

269265
assert report.active_images == expected_report.active_images
270-
assert (
271-
report.current_month_recos == expected_report.current_month_recos
272-
)
266+
assert report.current_month_recos == expected_report.current_month_recos
273267
assert report.failed_images == expected_report.failed_images
274268
assert report.inactive_images == expected_report.inactive_images
275269
assert report.name == expected_report.name
276-
assert (
277-
report.previous_month_recos == expected_report.previous_month_recos
278-
)
270+
assert report.previous_month_recos == expected_report.previous_month_recos
279271
assert report.processing_images == expected_report.processing_images
280272
assert report.reco_threshold == expected_report.reco_threshold
281273
assert report.request_quota == expected_report.request_quota
@@ -319,23 +311,15 @@ def test_get_target_record(
319311

320312
assert result.target_record == expected_target_record
321313

322-
assert (
323-
result.target_record.target_id == expected_target_record.target_id
324-
)
325-
assert (
326-
result.target_record.active_flag
327-
== expected_target_record.active_flag
328-
)
314+
assert result.target_record.target_id == expected_target_record.target_id
315+
assert result.target_record.active_flag == expected_target_record.active_flag
329316
assert result.target_record.name == expected_target_record.name
330317
assert result.target_record.width == expected_target_record.width
331318
assert (
332319
result.target_record.tracking_rating
333320
== expected_target_record.tracking_rating
334321
)
335-
assert (
336-
result.target_record.reco_rating
337-
== expected_target_record.reco_rating
338-
)
322+
assert result.target_record.reco_rating == expected_target_record.reco_rating
339323

340324
assert result.status == TargetStatuses.PROCESSING
341325

@@ -514,9 +498,7 @@ def test_custom_timeout(image: io.BytesIO | BinaryIO) -> None:
514498

515499
report = vws_client.get_target_summary_report(target_id=target_id)
516500
assert report.status == TargetStatuses.PROCESSING
517-
with pytest.raises(
518-
expected_exception=TargetProcessingTimeoutError
519-
):
501+
with pytest.raises(expected_exception=TargetProcessingTimeoutError):
520502
vws_client.wait_for_target_processed(
521503
target_id=target_id,
522504
timeout_seconds=0.1,

tests/test_vws_exceptions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,7 @@ def test_authentication_failure(
287287
with MockVWS() as mock:
288288
mock.add_database(database=database)
289289

290-
with pytest.raises(
291-
expected_exception=AuthenticationFailureError
292-
) as exc:
290+
with pytest.raises(expected_exception=AuthenticationFailureError) as exc:
293291
vws_client.add_target(
294292
name="x",
295293
width=1,

0 commit comments

Comments
 (0)