|
30 | 30 | from .common_others import get_function_host |
31 | 31 | from .common_pytest_marks import make_marked_parameter_value, get_param_argnames_as_list, \ |
32 | 32 | get_pytest_parametrize_marks, get_pytest_usefixture_marks, PYTEST3_OR_GREATER, PYTEST6_OR_GREATER, \ |
33 | | - PYTEST38_OR_GREATER, PYTEST34_OR_GREATER, PYTEST33_OR_GREATER, PYTEST32_OR_GREATER |
| 33 | + PYTEST38_OR_GREATER, PYTEST34_OR_GREATER, PYTEST33_OR_GREATER, PYTEST32_OR_GREATER, PYTEST71_OR_GREATER |
34 | 34 | from .common_pytest_lazy_values import is_lazy_value, is_lazy |
35 | 35 |
|
36 | 36 |
|
@@ -554,22 +554,28 @@ def set_callspec_arg_scope_to_function(callspec, arg_name): |
554 | 554 | callspec._arg2scopenum[arg_name] = get_pytest_function_scopeval() # noqa |
555 | 555 |
|
556 | 556 |
|
557 | | -from _pytest.python import _idval # noqa |
| 557 | +if PYTEST71_OR_GREATER: |
| 558 | + from _pytest.python import IdMaker # noqa |
558 | 559 |
|
559 | | -if PYTEST6_OR_GREATER: |
560 | | - _idval_kwargs = dict(idfn=None, |
561 | | - nodeid=None, # item is not used in pytest(>=6.0.0) nodeid is only used by idfn |
562 | | - config=None # if a config hook was available it would be used before this is called) |
563 | | - ) |
564 | | -elif PYTEST38_OR_GREATER: |
565 | | - _idval_kwargs = dict(idfn=None, |
566 | | - item=None, # item is only used by idfn |
567 | | - config=None # if a config hook was available it would be used before this is called) |
568 | | - ) |
| 560 | + _idval = IdMaker([], [], None, None, None, None, None)._idval |
| 561 | + _idval_kwargs = dict() |
569 | 562 | else: |
570 | | - _idval_kwargs = dict(idfn=None, |
571 | | - # config=None # if a config hook was available it would be used before this is called) |
572 | | - ) |
| 563 | + from _pytest.python import _idval # noqa |
| 564 | + |
| 565 | + if PYTEST6_OR_GREATER: |
| 566 | + _idval_kwargs = dict(idfn=None, |
| 567 | + nodeid=None, # item is not used in pytest(>=6.0.0) nodeid is only used by idfn |
| 568 | + config=None # if a config hook was available it would be used before this is called) |
| 569 | + ) |
| 570 | + elif PYTEST38_OR_GREATER: |
| 571 | + _idval_kwargs = dict(idfn=None, |
| 572 | + item=None, # item is only used by idfn |
| 573 | + config=None # if a config hook was available it would be used before this is called) |
| 574 | + ) |
| 575 | + else: |
| 576 | + _idval_kwargs = dict(idfn=None, |
| 577 | + # config=None # if a config hook was available it would be used before this is called) |
| 578 | + ) |
573 | 579 |
|
574 | 580 |
|
575 | 581 | def mini_idval( |
|
0 commit comments