Skip to content

Complex numbers in parameterizations have opaque IDs #8898

@gsmecher

Description

@gsmecher

When @parameterizing a test case with complex numbers:

@pytest.mark.parametrize("amplitude", [32768j])
def test_something(amplitude):
    # [...]

...the test case is enumerated using opaque IDs:

$ pytest-3 -v test.py 
test.py::test_something[amplitude0] PASSED                                   [100%]

It would be preferrable to add "complex" into the (short) list of types that are automatically converted via str().

I'm chasing this one down myself and will attach a PR. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: parametrizerelated to @pytest.mark.parametrizetype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions