pytest-spec icon indicating copy to clipboard operation
pytest-spec copied to clipboard

`docstring_summary` ignores parametrization arguments

Open alx72n opened this issue 2 years ago • 0 comments

Hello.

When you set docstring_summary in spec_test_format variable it ignores parametrizations arguments. I think it is a bug.

Failed scenario

Example test_code.py:

import pytest

@pytest.mark.parametrize("package", [
    "python",
    "python-pip",
])
def test_package_is_intalled(package):
    """Test package is installed."""
    assert True

Example pytest.ini:

[pytest]
spec_test_format = {result} {docstring_summary}

Actual output:

  ✓ Test package is installed.
  ✓ Test package is installed.

Expected output:

  ✓ Test package is installed[python]
  ✓ Test package is installed[python-pip]

Success scenario

If you remove pytest.ini file OR set it like this OR remove docstring everything works fine, actual and expected results are the same.

Example pytest.ini:

[pytest]
spec_test_format = {result} {name}

Actual==Expected output:

  ✓ Package is intalled[python]
  ✓ Package is intalled[python-pip]

alx72n avatar May 01 '22 22:05 alx72n