From da3fa6d3c76ff347c19845b85ca55f68fdb0123f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 23:03:23 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- ecommerce/discounts_test.py | 3 +-- flexiblepricing/api_test.py | 2 +- repl.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ecommerce/discounts_test.py b/ecommerce/discounts_test.py index b8968e9629..dea01d1d20 100644 --- a/ecommerce/discounts_test.py +++ b/ecommerce/discounts_test.py @@ -67,8 +67,7 @@ def test_discount_factory_adjustment(discounts, products): if type(discount_logic) is DollarsOffDiscount: discounted_price = product.price - discount.amount - if discounted_price < 0: - discounted_price = 0 + discounted_price = max(discounted_price, 0) elif type(discount_logic) is FixedPriceDiscount: discounted_price = discount.amount elif type(discount_logic) is PercentDiscount: diff --git a/flexiblepricing/api_test.py b/flexiblepricing/api_test.py index b538ba1068..cb4e81f0b4 100644 --- a/flexiblepricing/api_test.py +++ b/flexiblepricing/api_test.py @@ -432,7 +432,7 @@ def create_run_and_product_and_discount(self, user, courseware_object): return determine_courseware_flexible_price_discount(product, user) - def create_fp_and_compare_tiers( # noqa: PLR0913 + def create_fp_and_compare_tiers( self, courseware_object, income_usd, country_code, user, expected ): """ diff --git a/repl.py b/repl.py index bbe541539d..3982dfabaa 100755 --- a/repl.py +++ b/repl.py @@ -12,7 +12,7 @@ sys.exit( check_call( - [ # noqa: S603 + [ os.path.join(base_dir, "manage.py"), # noqa: PTH118 "shell", *sys.argv[1:],