Return all direct parametrization arguments of a node, so we don't mistake them for fixtures. Check https://github.com/pytest-dev/pytest/issues/5036. These things are done later as well when dealing with parametrization so this could be improved.
(node: nodes.Node)
| 1651 | |
| 1652 | |
| 1653 | def _get_direct_parametrize_args(node: nodes.Node) -> set[str]: |
| 1654 | """Return all direct parametrization arguments of a node, so we don't |
| 1655 | mistake them for fixtures. |
| 1656 | |
| 1657 | Check https://github.com/pytest-dev/pytest/issues/5036. |
| 1658 | |
| 1659 | These things are done later as well when dealing with parametrization |
| 1660 | so this could be improved. |
| 1661 | """ |
| 1662 | parametrize_argnames: set[str] = set() |
| 1663 | for marker in node.iter_markers(name="parametrize"): |
| 1664 | indirect = marker.kwargs.get("indirect", False) |
| 1665 | p_argnames, _ = ParameterSet._parse_parametrize_args( |
| 1666 | *marker.args, **marker.kwargs |
| 1667 | ) |
| 1668 | p_directness = _resolve_args_directness(p_argnames, indirect, node.nodeid) |
| 1669 | parametrize_argnames.update( |
| 1670 | argname |
| 1671 | for argname, directness in p_directness.items() |
| 1672 | if directness == "direct" |
| 1673 | ) |
| 1674 | return parametrize_argnames |
| 1675 | |
| 1676 | |
| 1677 | def deduplicate_names(*seqs: Iterable[str]) -> tuple[str, ...]: |
no test coverage detected