Skip to content

Commit e725796

Browse files
authored
Merge pull request #119 from jsmadis/fix_pytest
Fix _idval_kwargs with pytest >=6.0.0
2 parents 1bd9f7d + 9b1911e commit e725796

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pytest_cases/common_pytest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,12 @@ def get_pytest_function_scopenum():
427427

428428
from _pytest.python import _idval # noqa
429429

430-
431-
if LooseVersion(pytest.__version__) >= LooseVersion('3.0.0'):
430+
if LooseVersion(pytest.__version__) >= LooseVersion('6.0.0'):
431+
_idval_kwargs = dict(idfn=None,
432+
nodeid=None, # item is not used in pytest(>=6.0.0) nodeid is only used by idfn
433+
config=None # if a config hook was available it would be used before this is called)
434+
)
435+
elif LooseVersion(pytest.__version__) >= LooseVersion('3.0.0'):
432436
_idval_kwargs = dict(idfn=None,
433437
item=None, # item is only used by idfn
434438
config=None # if a config hook was available it would be used before this is called)

0 commit comments

Comments
 (0)