pchomik / pytest-spec

Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.
GNU General Public License v2.0
100 stars 19 forks source link

`docstring_summary` ignores parametrization arguments #53

Open alx72n opened 2 years ago

alx72n commented 2 years ago

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]