Skip to content

pytest-html does not escape HTML in testId (v4.2.0) #1024

@dmitry-lipetsk

Description

@dmitry-lipetsk

Hello,

I created a parametrize test where testId contains the following text:

<span style="font-weight: bold; color: red; font-size: 2em;">text</span>

pytest-html generated the next report:

Image

Is it an expected behaviour?

Test code:

import pytest        
@pytest.mark.parametrize(
    "data",
    [
        '<span style="font-weight: bold; color: red; font-size: 2em;">text</span>',
    ],
)
def test_unescape(data): print("ha-ha")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions