refactor(test): remove xfail during pytest_generate_tests before parameterizing

ref: #938
This commit is contained in:
2025-08-04 16:38:59 +09:30
parent f5f4eb3ff2
commit f525411ace
7 changed files with 19 additions and 10 deletions

View File

@ -262,6 +262,15 @@ def pytest_generate_tests(metafunc):
if len(arg_values) > 0:
# Get the test method
test_func = getattr(metafunc.cls, metafunc.definition.name, None)
# Remove previous xfail mark if present
if test_func and hasattr(test_func, 'pytestmark'):
test_func.pytestmark = [
mark for mark in test_func.pytestmark if mark.name != 'xfail'
]
metafunc.parametrize(
argnames = [
*fixture_parameters