Repository: pytest-dev/pytest-html (language: python)

Issue:
xfailed tests are labeled "unexpected failures"
xfailed tests are labeled "unexpected failures" while these are "expected failures"

https://github.com/pytest-dev/pytest-html/blame/3e21601f49cc30dbdb0e06ed79c146d816dd5b09/src/pytest_html/report_data.py#L28


Discussion / hints:
Adding an example of the result in a report
![image](https://github.com/pytest-dev/pytest-html/assets/110860614/3b7ef535-26ba-405a-9706-a954fbdfc03f)

Nobody expects the Unexpected Failure!
<img width="442" alt="Screenshot 2023-09-07 at 12 23 42 PM" src="https://github.com/pytest-dev/pytest-html/assets/4308435/f389b080-110e-4b4f-a17d-379056b4b6fb">

Oh noes! 🙈 

Thanks for reporting! Will fix asap.

Fix patch:
diff --git a/docs/changelog.rst b/docs/changelog.rst
index c923c015..9b2c5f2a 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -6,6 +6,13 @@ Versions follow `Semantic Versioning`_ (``<major>.<minor>.<patch>``).
 Version History
 ---------------
 
+4.0.1 (2023-09-10)
+~~~~~~~~~~~~~~~~~~
+
+* Fix incorrectly labeled outcome.
+
+  * Thanks to `@lodagro <https://github.com/lodagro>`_ for reporting
+
 4.0.0 (2023-09-01)
 ~~~~~~~~~~~~~~~~~~
 


Test patch:
diff --git a/src/pytest_html/report_data.py b/src/pytest_html/report_data.py
index b3a70809..46225009 100644
--- a/src/pytest_html/report_data.py
+++ b/src/pytest_html/report_data.py
@@ -25,7 +25,7 @@ def __init__(self, config):
             "failed": {"label": "Failed", "value": 0},
             "passed": {"label": "Passed", "value": 0},
             "skipped": {"label": "Skipped", "value": 0},
-            "xfailed": {"label": "Unexpected failures", "value": 0},
+            "xfailed": {"label": "Expected failures", "value": 0},
             "xpassed": {"label": "Unexpected passes", "value": 0},
             "error": {"label": "Errors", "value": 0},
             "rerun": {"label": "Reruns", "value": 0},
diff --git a/testing/test_integration.py b/testing/test_integration.py
index 15a6cd0d..39b46bf0 100644
--- a/testing/test_integration.py
+++ b/testing/test_integration.py
@@ -20,7 +20,7 @@
     "skipped": "Skipped",
     "failed": "Failed",
     "error": "Errors",
-    "xfailed": "Unexpected failures",
+    "xfailed": "Expected failures",
     "xpassed": "Unexpected passes",
     "rerun": "Reruns",
 }