Skip to content

Convert pytest.param

Convert pytest.param converts parametrized values between plain values and explicit pytest.param(...) calls.

How to use it

Place the caret inside a pytest.mark.parametrize values list, then run BetterPy: Convert argument to pytest.param() or the reverse conversion intention.

When it helps

Use this intention when adding or removing per-case metadata such as ids and marks while keeping the parameter value structure correct.

Notes

  • BetterPy imports pytest when converting plain values to pytest.param(...).
  • Values with marks or ids are not converted back to plain values.
  • The feature is gated by the Convert pytest.param setting under Settings | BetterPy | Testing (Pytest) | Parametrize.