Skip to content

Commit 2101d67

Browse files
committed
Make some manual fixes
1 parent 458429c commit 2101d67

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

integration_test/integration_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def get_pdf_for_letter(python_client, id):
121121

122122
count += 3
123123
if count > 45:
124-
print(f"pdf {id} not ready at {datetime.utcnow()} after 45 seconds")
124+
print(f"pdf {id} not ready at {datetime.utcnow()} after 45 seconds") # noqa: T201
125125
raise
126126
else:
127127
time.sleep(3)
@@ -262,7 +262,7 @@ def test_integration():
262262
if os.environ["INBOUND_SMS_QUERY_KEY"]:
263263
get_received_text_messages()
264264

265-
print("notifications-python-client integration tests are successful")
265+
print("notifications-python-client integration tests are successful") # noqa: T201
266266

267267

268268
if __name__ == "__main__":

notifications_python_client/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def _perform_request(self, method, url, kwargs):
9696
logger.warning(
9797
"API %s request on %s failed with %s '%s'", method, url, api_error.status_code, api_error.message
9898
)
99-
raise api_error
99+
raise api_error from e
100100
finally:
101101
elapsed_time = time.monotonic() - start_time
102102
logger.debug("API %s request on %s finished in %s", method, url, elapsed_time)

notifications_python_client/notifications.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ def get_received_texts_iterator(self, older_than=None):
6969
result = self.get_received_texts(older_than=older_than)
7070
received_texts = result.get("received_text_messages")
7171
while received_texts:
72-
for received_text in received_texts:
73-
yield received_text
72+
yield from received_texts
7473
next_link = result["links"].get("next")
7574
received_text_id = re.search("[0-F]{8}-[0-F]{4}-[0-F]{4}-[0-F]{4}-[0-F]{12}", next_link, re.I).group(0)
7675
result = self.get_received_texts_iterator(older_than=received_text_id)
@@ -108,8 +107,7 @@ def get_all_notifications_iterator(self, status=None, template_type=None, refere
108107
result = self.get_all_notifications(status, template_type, reference, older_than)
109108
notifications = result.get("notifications")
110109
while notifications:
111-
for notification in notifications:
112-
yield notification
110+
yield from notifications
113111
next_link = result["links"].get("next")
114112
notification_id = re.search("[0-F]{8}-[0-F]{4}-[0-F]{4}-[0-F]{4}-[0-F]{12}", next_link, re.I).group(0)
115113
result = self.get_all_notifications(status, template_type, reference, notification_id)

utils/make_api_call.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa: T201, T203
12
"""
23
34
Usage:

0 commit comments

Comments
 (0)