@@ -9,22 +9,14 @@ def order():
99
1010
1111@pytest .mark .parametrize (
12- "func, discount" ,
13- [
14- (ten_percent_discount , 10.0 ),
15- (on_sale_discount , 45.0 )
16- ]
12+ "func, discount" , [(ten_percent_discount , 10.0 ), (on_sale_discount , 45.0 )]
1713)
1814def test_discount_function_return (func , order , discount ):
1915 assert func (order ) == discount
2016
2117
2218@pytest .mark .parametrize (
23- "func, price" ,
24- [
25- (ten_percent_discount , 100 ),
26- (on_sale_discount , 100 )
27- ]
19+ "func, price" , [(ten_percent_discount , 100 ), (on_sale_discount , 100 )]
2820)
2921def test_order_discount_strategy_validate_success (func , price ):
3022 order = Order (price , func )
@@ -41,10 +33,7 @@ def test_order_discount_strategy_validate_error():
4133
4234@pytest .mark .parametrize (
4335 "func, price, discount" ,
44- [
45- (ten_percent_discount , 100 , 90.0 ),
46- (on_sale_discount , 100 , 55.0 )
47- ]
36+ [(ten_percent_discount , 100 , 90.0 ), (on_sale_discount , 100 , 55.0 )],
4837)
4938def test_discount_apply_success (func , price , discount ):
5039 order = Order (price , func )
0 commit comments