Skip to content

Commit a84469b

Browse files
author
Sylvain MARIE
committed
added missing hook arg passing
1 parent b69f0f1 commit a84469b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

pytest_cases/main_fixtures.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,8 @@ def _create_fixture_product(argvalue_i, fixture_ref_positions, param_names_str,
12081208
# unpack the fixture references
12091209
_vtuple = argvalues[argvalue_i]
12101210
fixtures_or_values = tuple(v.fixture if i in fixture_ref_positions else v for i, v in enumerate(_vtuple))
1211-
product_fix = _fixture_product(caller_module, p_fix_name, fixtures_or_values, fixture_ref_positions)
1211+
product_fix = _fixture_product(caller_module, p_fix_name, fixtures_or_values, fixture_ref_positions,
1212+
hook=hook)
12121213
return product_fix
12131214

12141215
# then create the decorator
@@ -1244,9 +1245,10 @@ def parametrize_plus_decorate(test_func):
12441245
prev_i = -1
12451246
for i, j_list in fixture_indices:
12461247
if i > prev_i + 1:
1247-
# there was a non-empty group of 'normal' parameters before this fixture_ref.
1248-
# create a new fixture parametrized with all of that consecutive group.
1249-
param_fix, _id_for_fix = _create_param_fixture(prev_i + 1, i, param_names_str, test_func.__name__)
1248+
# there was a non-empty group of 'normal' parameters before the fixture_ref at <i>.
1249+
# create a new "param" fixture parametrized with all of that consecutive group.
1250+
param_fix, _id_for_fix = _create_param_fixture(prev_i + 1, i, param_names_str, test_func.__name__,
1251+
hook=hook)
12501252
fixtures_to_union.append(param_fix)
12511253
fixtures_to_union_names_for_ids.append(_id_for_fix)
12521254

@@ -1257,8 +1259,9 @@ def parametrize_plus_decorate(test_func):
12571259
id_for_fixture = apply_id_style(get_fixture_name(referenced_fixture), param_names_str, IdStyle.explicit)
12581260
fixtures_to_union_names_for_ids.append(id_for_fixture)
12591261
else:
1260-
# create a fixture refering to all the fixtures required in the tuple
1261-
prod_fix = _create_fixture_product(i, j_list, param_names_str, test_func.__name__)
1262+
# argvalues[i] is a tuple of argvalues, some of them being fixture_ref. create a fixture refering to all of them
1263+
prod_fix = _create_fixture_product(i, j_list, param_names_str, test_func.__name__,
1264+
hook=hook)
12621265
fixtures_to_union.append(prod_fix)
12631266
_id_product = "fixtureproduct__%s" % i
12641267
id_for_fixture = apply_id_style(_id_product, param_names_str, IdStyle.explicit)
@@ -1268,7 +1271,8 @@ def parametrize_plus_decorate(test_func):
12681271
# handle last consecutive group of normal parameters, if any
12691272
i = len(argvalues)
12701273
if i > prev_i + 1:
1271-
param_fix, _id_for_fix = _create_param_fixture(prev_i + 1, i, param_names_str, test_func.__name__)
1274+
param_fix, _id_for_fix = _create_param_fixture(prev_i + 1, i, param_names_str, test_func.__name__,
1275+
hook=hook)
12721276
fixtures_to_union.append(param_fix)
12731277
fixtures_to_union_names_for_ids.append(_id_for_fix)
12741278

0 commit comments

Comments
 (0)