Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion backends/arm/test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def parametrize(
test_data: dict[str, Any],
xfails: dict[str, xfail_type] | None = None,
strict: bool = True,
flakies: dict[str, int] | None = None,
):
"""
Custom version of pytest.mark.parametrize with some syntatic sugar and added xfail functionality
Expand All @@ -237,12 +238,17 @@ def parametrize(
"""
if xfails is None:
xfails = {}
if flakies is None:
flakies = {}

def decorator_func(func):
"""Test data is transformed from a dict of (id, data) pairs to a list of pytest params to work with the native pytests parametrize function"""
pytest_testsuite = []
for id, test_parameters in test_data.items():
if id in xfails:
if id in flakies:
# Mark this parameter as flaky with given reruns
marker = (pytest.mark.flaky(reruns=flakies[id]),)
elif id in xfails:
xfail_info = xfails[id]
reason = ""
raises = None
Expand Down
6 changes: 5 additions & 1 deletion backends/arm/test/ops/test_bmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ def test_bmm_vgf_FP(test_data: input_t1):
pipeline.run()


@common.parametrize("test_data", BMMSingleInput.test_data_generators)
@common.parametrize(
"test_data",
BMMSingleInput.test_data_generators,
flakies={"rand_big_1": 3},
)
@common.SkipIfNoModelConverter
def test_bmm_vgf_FP_single_input(test_data: input_t1):
pipeline = VgfPipeline[input_t1](
Expand Down
Loading