diff --git a/requirements.txt b/requirements.txt index 05f5feee8..c218d57f2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,10 +7,7 @@ pytest-cov >= 2.8.1, < 2.11.0 pytest-mock >= 2.0.0 pytest-xdist >= 1.31.0 pytest >= 6.0.0 -# black==23.11.0 supports py311/py312 targets, -# but it's keen to reformat way too many files -black==21.12b0 -click==8.0.4 # Version 8.1 breaks black +black == 22.8.0 flake8 coverage >= 4.5.3, < 5 coveralls diff --git a/stripe/api_resources/account.py b/stripe/api_resources/account.py index 879640d6d..639c0995c 100644 --- a/stripe/api_resources/account.py +++ b/stripe/api_resources/account.py @@ -3600,7 +3600,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/apple_pay_domain.py b/stripe/api_resources/apple_pay_domain.py index d10cac52d..881a1c134 100644 --- a/stripe/api_resources/apple_pay_domain.py +++ b/stripe/api_resources/apple_pay_domain.py @@ -172,7 +172,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/application_fee.py b/stripe/api_resources/application_fee.py index d73ccdb25..342c21926 100644 --- a/stripe/api_resources/application_fee.py +++ b/stripe/api_resources/application_fee.py @@ -221,7 +221,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/apps/secret.py b/stripe/api_resources/apps/secret.py index ba9cd9161..d3ada0668 100644 --- a/stripe/api_resources/apps/secret.py +++ b/stripe/api_resources/apps/secret.py @@ -289,7 +289,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/balance_transaction.py b/stripe/api_resources/balance_transaction.py index 38aad5bbc..a31ab3872 100644 --- a/stripe/api_resources/balance_transaction.py +++ b/stripe/api_resources/balance_transaction.py @@ -285,7 +285,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/billing_portal/configuration.py b/stripe/api_resources/billing_portal/configuration.py index c2853380e..e3dab9d8c 100644 --- a/stripe/api_resources/billing_portal/configuration.py +++ b/stripe/api_resources/billing_portal/configuration.py @@ -701,7 +701,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index 6323d0148..a0795a066 100644 --- a/stripe/api_resources/charge.py +++ b/stripe/api_resources/charge.py @@ -2324,7 +2324,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/checkout/session.py b/stripe/api_resources/checkout/session.py index 8643447f8..954bc6b00 100644 --- a/stripe/api_resources/checkout/session.py +++ b/stripe/api_resources/checkout/session.py @@ -3713,7 +3713,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/country_spec.py b/stripe/api_resources/country_spec.py index 7a1d2216a..b98e13f73 100644 --- a/stripe/api_resources/country_spec.py +++ b/stripe/api_resources/country_spec.py @@ -123,7 +123,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/coupon.py b/stripe/api_resources/coupon.py index 6144369d0..97b45b05c 100644 --- a/stripe/api_resources/coupon.py +++ b/stripe/api_resources/coupon.py @@ -354,7 +354,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/credit_note.py b/stripe/api_resources/credit_note.py index 3a4d97212..c91056b2d 100644 --- a/stripe/api_resources/credit_note.py +++ b/stripe/api_resources/credit_note.py @@ -723,7 +723,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/credit_note_line_item.py b/stripe/api_resources/credit_note_line_item.py index 0569cb272..85dc7c526 100644 --- a/stripe/api_resources/credit_note_line_item.py +++ b/stripe/api_resources/credit_note_line_item.py @@ -179,7 +179,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/customer.py b/stripe/api_resources/customer.py index ebda900ea..7679c19ca 100644 --- a/stripe/api_resources/customer.py +++ b/stripe/api_resources/customer.py @@ -1647,7 +1647,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/customer_cash_balance_transaction.py b/stripe/api_resources/customer_cash_balance_transaction.py index f9c8901ad..0b8ea55ef 100644 --- a/stripe/api_resources/customer_cash_balance_transaction.py +++ b/stripe/api_resources/customer_cash_balance_transaction.py @@ -239,7 +239,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/dispute.py b/stripe/api_resources/dispute.py index 1a6067ae6..e3bde8751 100644 --- a/stripe/api_resources/dispute.py +++ b/stripe/api_resources/dispute.py @@ -554,7 +554,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/event.py b/stripe/api_resources/event.py index 9be307871..27c09064d 100644 --- a/stripe/api_resources/event.py +++ b/stripe/api_resources/event.py @@ -413,7 +413,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/exchange_rate.py b/stripe/api_resources/exchange_rate.py index fe3cf7a69..68c7c395f 100644 --- a/stripe/api_resources/exchange_rate.py +++ b/stripe/api_resources/exchange_rate.py @@ -99,7 +99,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/file.py b/stripe/api_resources/file.py index e07ec9246..ef8f9881c 100644 --- a/stripe/api_resources/file.py +++ b/stripe/api_resources/file.py @@ -164,7 +164,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/file_link.py b/stripe/api_resources/file_link.py index 42ec62151..b3e1bb553 100644 --- a/stripe/api_resources/file_link.py +++ b/stripe/api_resources/file_link.py @@ -205,7 +205,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/financial_connections/account.py b/stripe/api_resources/financial_connections/account.py index e16a57fc0..17b638603 100644 --- a/stripe/api_resources/financial_connections/account.py +++ b/stripe/api_resources/financial_connections/account.py @@ -388,7 +388,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/identity/verification_report.py b/stripe/api_resources/identity/verification_report.py index e32b3d8c2..12f665aff 100644 --- a/stripe/api_resources/identity/verification_report.py +++ b/stripe/api_resources/identity/verification_report.py @@ -412,7 +412,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/identity/verification_session.py b/stripe/api_resources/identity/verification_session.py index afdd75925..a9d8f7b22 100644 --- a/stripe/api_resources/identity/verification_session.py +++ b/stripe/api_resources/identity/verification_session.py @@ -538,7 +538,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/invoice.py b/stripe/api_resources/invoice.py index 3ba096701..c23275d1c 100644 --- a/stripe/api_resources/invoice.py +++ b/stripe/api_resources/invoice.py @@ -3761,7 +3761,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/invoice_item.py b/stripe/api_resources/invoice_item.py index 212d0e96e..d245a7e07 100644 --- a/stripe/api_resources/invoice_item.py +++ b/stripe/api_resources/invoice_item.py @@ -548,7 +548,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index 0817de67d..14045de7c 100644 --- a/stripe/api_resources/issuing/authorization.py +++ b/stripe/api_resources/issuing/authorization.py @@ -988,7 +988,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/card.py b/stripe/api_resources/issuing/card.py index b8ee4a4ee..a29821c93 100644 --- a/stripe/api_resources/issuing/card.py +++ b/stripe/api_resources/issuing/card.py @@ -1572,7 +1572,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/cardholder.py b/stripe/api_resources/issuing/cardholder.py index b7a7c904b..5a2d8b53d 100644 --- a/stripe/api_resources/issuing/cardholder.py +++ b/stripe/api_resources/issuing/cardholder.py @@ -1727,7 +1727,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/dispute.py b/stripe/api_resources/issuing/dispute.py index de80e0d2a..d59d9eacd 100644 --- a/stripe/api_resources/issuing/dispute.py +++ b/stripe/api_resources/issuing/dispute.py @@ -907,7 +907,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/token.py b/stripe/api_resources/issuing/token.py index 40df1254f..40f9903ca 100644 --- a/stripe/api_resources/issuing/token.py +++ b/stripe/api_resources/issuing/token.py @@ -332,7 +332,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/issuing/transaction.py b/stripe/api_resources/issuing/transaction.py index 36f17bddd..4288a7def 100644 --- a/stripe/api_resources/issuing/transaction.py +++ b/stripe/api_resources/issuing/transaction.py @@ -790,7 +790,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index 515daee44..67a250bf6 100644 --- a/stripe/api_resources/payment_intent.py +++ b/stripe/api_resources/payment_intent.py @@ -8119,7 +8119,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_link.py b/stripe/api_resources/payment_link.py index 823d7869a..9c8807967 100644 --- a/stripe/api_resources/payment_link.py +++ b/stripe/api_resources/payment_link.py @@ -2145,7 +2145,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_method.py b/stripe/api_resources/payment_method.py index 9a0ac6ef7..1ee32c19d 100644 --- a/stripe/api_resources/payment_method.py +++ b/stripe/api_resources/payment_method.py @@ -1960,7 +1960,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_method_configuration.py b/stripe/api_resources/payment_method_configuration.py index fb7777b18..227d26f41 100644 --- a/stripe/api_resources/payment_method_configuration.py +++ b/stripe/api_resources/payment_method_configuration.py @@ -2308,7 +2308,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payment_method_domain.py b/stripe/api_resources/payment_method_domain.py index 01663e8c3..14ec81192 100644 --- a/stripe/api_resources/payment_method_domain.py +++ b/stripe/api_resources/payment_method_domain.py @@ -253,7 +253,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/payout.py b/stripe/api_resources/payout.py index 6a6ccfbcf..3cbd657f0 100644 --- a/stripe/api_resources/payout.py +++ b/stripe/api_resources/payout.py @@ -409,7 +409,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/plan.py b/stripe/api_resources/plan.py index 98b1a853b..5690ae440 100644 --- a/stripe/api_resources/plan.py +++ b/stripe/api_resources/plan.py @@ -475,7 +475,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/price.py b/stripe/api_resources/price.py index ee0aa957a..88b278912 100644 --- a/stripe/api_resources/price.py +++ b/stripe/api_resources/price.py @@ -776,7 +776,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/product.py b/stripe/api_resources/product.py index 680d877ea..10a8a1678 100644 --- a/stripe/api_resources/product.py +++ b/stripe/api_resources/product.py @@ -641,7 +641,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/promotion_code.py b/stripe/api_resources/promotion_code.py index 6fca50553..17d878e50 100644 --- a/stripe/api_resources/promotion_code.py +++ b/stripe/api_resources/promotion_code.py @@ -323,7 +323,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/quote.py b/stripe/api_resources/quote.py index c68360971..05741199e 100644 --- a/stripe/api_resources/quote.py +++ b/stripe/api_resources/quote.py @@ -1326,7 +1326,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/radar/early_fraud_warning.py b/stripe/api_resources/radar/early_fraud_warning.py index f40b5914c..ca3f3f722 100644 --- a/stripe/api_resources/radar/early_fraud_warning.py +++ b/stripe/api_resources/radar/early_fraud_warning.py @@ -112,7 +112,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/radar/value_list.py b/stripe/api_resources/radar/value_list.py index 2266ef0d7..a3deddfd1 100644 --- a/stripe/api_resources/radar/value_list.py +++ b/stripe/api_resources/radar/value_list.py @@ -284,7 +284,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/radar/value_list_item.py b/stripe/api_resources/radar/value_list_item.py index 32e4989bf..34aa0b3af 100644 --- a/stripe/api_resources/radar/value_list_item.py +++ b/stripe/api_resources/radar/value_list_item.py @@ -230,7 +230,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/refund.py b/stripe/api_resources/refund.py index e3f24ca7e..02c0647d1 100644 --- a/stripe/api_resources/refund.py +++ b/stripe/api_resources/refund.py @@ -396,7 +396,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/reporting/report_run.py b/stripe/api_resources/reporting/report_run.py index 7d9d2e756..3d1d6de03 100644 --- a/stripe/api_resources/reporting/report_run.py +++ b/stripe/api_resources/reporting/report_run.py @@ -262,7 +262,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/reporting/report_type.py b/stripe/api_resources/reporting/report_type.py index 4993c95dc..096bea60b 100644 --- a/stripe/api_resources/reporting/report_type.py +++ b/stripe/api_resources/reporting/report_type.py @@ -95,7 +95,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/review.py b/stripe/api_resources/review.py index b6f8aa473..256967bf4 100644 --- a/stripe/api_resources/review.py +++ b/stripe/api_resources/review.py @@ -285,7 +285,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/setup_attempt.py b/stripe/api_resources/setup_attempt.py index 2b914ccfd..ef9054911 100644 --- a/stripe/api_resources/setup_attempt.py +++ b/stripe/api_resources/setup_attempt.py @@ -773,7 +773,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/setup_intent.py b/stripe/api_resources/setup_intent.py index a909fd834..d4a28c7f5 100644 --- a/stripe/api_resources/setup_intent.py +++ b/stripe/api_resources/setup_intent.py @@ -3561,7 +3561,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/shipping_rate.py b/stripe/api_resources/shipping_rate.py index e35f9c1a8..3606e60a5 100644 --- a/stripe/api_resources/shipping_rate.py +++ b/stripe/api_resources/shipping_rate.py @@ -387,7 +387,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/sigma/scheduled_query_run.py b/stripe/api_resources/sigma/scheduled_query_run.py index 2865a6ae2..7e157828a 100644 --- a/stripe/api_resources/sigma/scheduled_query_run.py +++ b/stripe/api_resources/sigma/scheduled_query_run.py @@ -119,7 +119,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/subscription.py b/stripe/api_resources/subscription.py index 5e525b5f6..1658e501f 100644 --- a/stripe/api_resources/subscription.py +++ b/stripe/api_resources/subscription.py @@ -2070,7 +2070,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/subscription_item.py b/stripe/api_resources/subscription_item.py index d49fddd8e..0d2cb356c 100644 --- a/stripe/api_resources/subscription_item.py +++ b/stripe/api_resources/subscription_item.py @@ -496,7 +496,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/subscription_schedule.py b/stripe/api_resources/subscription_schedule.py index 838ff0786..e9bab3550 100644 --- a/stripe/api_resources/subscription_schedule.py +++ b/stripe/api_resources/subscription_schedule.py @@ -1419,7 +1419,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/tax/registration.py b/stripe/api_resources/tax/registration.py index 525cae5ea..49dc59e33 100644 --- a/stripe/api_resources/tax/registration.py +++ b/stripe/api_resources/tax/registration.py @@ -1684,7 +1684,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/tax_code.py b/stripe/api_resources/tax_code.py index 503b3fffc..5da2a72b4 100644 --- a/stripe/api_resources/tax_code.py +++ b/stripe/api_resources/tax_code.py @@ -78,7 +78,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/tax_rate.py b/stripe/api_resources/tax_rate.py index 6cbe121d7..ee913609f 100644 --- a/stripe/api_resources/tax_rate.py +++ b/stripe/api_resources/tax_rate.py @@ -302,7 +302,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/terminal/configuration.py b/stripe/api_resources/terminal/configuration.py index f444acb9f..a381f2a34 100644 --- a/stripe/api_resources/terminal/configuration.py +++ b/stripe/api_resources/terminal/configuration.py @@ -1041,7 +1041,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/terminal/location.py b/stripe/api_resources/terminal/location.py index 10c6e65b5..c77d267dc 100644 --- a/stripe/api_resources/terminal/location.py +++ b/stripe/api_resources/terminal/location.py @@ -309,7 +309,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/terminal/reader.py b/stripe/api_resources/terminal/reader.py index 17f8b7544..576db1396 100644 --- a/stripe/api_resources/terminal/reader.py +++ b/stripe/api_resources/terminal/reader.py @@ -707,7 +707,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/test_helpers/test_clock.py b/stripe/api_resources/test_helpers/test_clock.py index 01404bc07..c8616ef1c 100644 --- a/stripe/api_resources/test_helpers/test_clock.py +++ b/stripe/api_resources/test_helpers/test_clock.py @@ -292,7 +292,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/topup.py b/stripe/api_resources/topup.py index a2929ee49..67ddbf14b 100644 --- a/stripe/api_resources/topup.py +++ b/stripe/api_resources/topup.py @@ -363,7 +363,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/transfer.py b/stripe/api_resources/transfer.py index db04591ad..132f5126c 100644 --- a/stripe/api_resources/transfer.py +++ b/stripe/api_resources/transfer.py @@ -326,7 +326,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/credit_reversal.py b/stripe/api_resources/treasury/credit_reversal.py index e160a67c9..683a27a35 100644 --- a/stripe/api_resources/treasury/credit_reversal.py +++ b/stripe/api_resources/treasury/credit_reversal.py @@ -188,7 +188,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/debit_reversal.py b/stripe/api_resources/treasury/debit_reversal.py index 06463f4d4..d04a8f56c 100644 --- a/stripe/api_resources/treasury/debit_reversal.py +++ b/stripe/api_resources/treasury/debit_reversal.py @@ -204,7 +204,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/financial_account.py b/stripe/api_resources/treasury/financial_account.py index 288fea606..8b81b3f74 100644 --- a/stripe/api_resources/treasury/financial_account.py +++ b/stripe/api_resources/treasury/financial_account.py @@ -822,7 +822,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/inbound_transfer.py b/stripe/api_resources/treasury/inbound_transfer.py index 102a5126a..5de0bf281 100644 --- a/stripe/api_resources/treasury/inbound_transfer.py +++ b/stripe/api_resources/treasury/inbound_transfer.py @@ -469,7 +469,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/outbound_payment.py b/stripe/api_resources/treasury/outbound_payment.py index 9ab1b169b..a42b87e6b 100644 --- a/stripe/api_resources/treasury/outbound_payment.py +++ b/stripe/api_resources/treasury/outbound_payment.py @@ -653,7 +653,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/outbound_transfer.py b/stripe/api_resources/treasury/outbound_transfer.py index 06c54eabf..aefef73b8 100644 --- a/stripe/api_resources/treasury/outbound_transfer.py +++ b/stripe/api_resources/treasury/outbound_transfer.py @@ -488,7 +488,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/received_credit.py b/stripe/api_resources/treasury/received_credit.py index d3b2b7a42..43bfd8950 100644 --- a/stripe/api_resources/treasury/received_credit.py +++ b/stripe/api_resources/treasury/received_credit.py @@ -387,7 +387,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/received_debit.py b/stripe/api_resources/treasury/received_debit.py index 64ce2f9fc..f038abfc8 100644 --- a/stripe/api_resources/treasury/received_debit.py +++ b/stripe/api_resources/treasury/received_debit.py @@ -336,7 +336,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/transaction.py b/stripe/api_resources/treasury/transaction.py index fba858faa..a0130d4d1 100644 --- a/stripe/api_resources/treasury/transaction.py +++ b/stripe/api_resources/treasury/transaction.py @@ -297,7 +297,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/treasury/transaction_entry.py b/stripe/api_resources/treasury/transaction_entry.py index b22cb7a3f..2f330eb87 100644 --- a/stripe/api_resources/treasury/transaction_entry.py +++ b/stripe/api_resources/treasury/transaction_entry.py @@ -291,7 +291,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/api_resources/webhook_endpoint.py b/stripe/api_resources/webhook_endpoint.py index 5f5a285f6..1366ea026 100644 --- a/stripe/api_resources/webhook_endpoint.py +++ b/stripe/api_resources/webhook_endpoint.py @@ -496,7 +496,6 @@ def list( params=params, ) if not isinstance(result, ListObject): - raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) diff --git a/stripe/http_client.py b/stripe/http_client.py index 94349a917..cbc4873e3 100644 --- a/stripe/http_client.py +++ b/stripe/http_client.py @@ -385,7 +385,6 @@ def _request_internal(self, method, url, headers, post_data, is_streaming): return content, status_code, result.headers def _handle_request_error(self, e) -> NoReturn: - # Catch SSL error first as it belongs to ConnectionError, # but we don't want to retry if isinstance(e, self.requests.exceptions.SSLError): diff --git a/stripe/multipart_data_generator.py b/stripe/multipart_data_generator.py index 48fb9e5bc..9731cd343 100644 --- a/stripe/multipart_data_generator.py +++ b/stripe/multipart_data_generator.py @@ -83,4 +83,4 @@ def _write_file(self, f): self._write(file_contents) def _initialize_boundary(self): - return random.randint(0, 2 ** 63) + return random.randint(0, 2**63) diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index 383e775fc..77ebb2855 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -67,14 +67,18 @@ def __eq__(self, other): ) def __repr__(self): - return "APIHeaderMatcher(request_method=%s, api_key=%s, extra=%s, " "user_agent=%s, app_info=%s, idempotency_key=%s, fail_platform_call=%s)" % ( - repr(self.request_method), - repr(self.api_key), - repr(self.extra), - repr(self.user_agent), - repr(self.app_info), - repr(self.idempotency_key), - repr(self.fail_platform_call), + return ( + "APIHeaderMatcher(request_method=%s, api_key=%s, extra=%s, " + "user_agent=%s, app_info=%s, idempotency_key=%s, fail_platform_call=%s)" + % ( + repr(self.request_method), + repr(self.api_key), + repr(self.extra), + repr(self.user_agent), + repr(self.app_info), + repr(self.idempotency_key), + repr(self.fail_platform_call), + ) ) def _keys_match(self, other): diff --git a/tests/test_http_client.py b/tests/test_http_client.py index 66e4ff9da..45ce47177 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -485,7 +485,6 @@ def response(code=200, headers={}): @pytest.fixture def mock_retry(self, mocker, session, request_mock): def mock_retry(retry_error_num=0, no_retry_error_num=0, responses=[]): - # Mocking classes of exception we catch. Any group of exceptions # with the same inheritance pattern will work request_root_error_class = Exception