Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
behave-html-pretty-formatter 1.16.1
=================================
Fixing bug with boolean values in pyproject.toml

behave-html-pretty-formatter 1.16
=================================
Improve readability.
Expand Down
12 changes: 4 additions & 8 deletions behave_html_pretty_formatter/html_pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ def generate_feature(self, formatter):
# Filter features.
with div("Scenarios Filter: ", cls="feature-summary-row"):
for status in EXPECTED_STATUSES:

# If there is a Status with zero counter, skip it.
if stats.get(status.name.capitalize(), 0) == 0:
continue
Expand Down Expand Up @@ -575,7 +574,6 @@ def generate_scenario(self, formatter):
cls=f"scenario-filter-container {self.status.name}",
id=f"f{self.feature.counter}-s{self.counter}",
):

# Scenario header.
with div(
cls=f"scenario-header {common_cls}",
Expand Down Expand Up @@ -962,7 +960,7 @@ def generate_table(self, formatter):
with table(cls="table"):
# Make a heading.
with thead(
onclick="toggle_hash(" f"'table_{PrettyHTMLFormatter.table_number}')",
onclick=f"toggle_hash('table_{PrettyHTMLFormatter.table_number}')",
):
line = tr()
for heading in table_headings:
Expand Down Expand Up @@ -990,8 +988,7 @@ def generate_text(self, formatter):
with table(cls="table"):
if formatter.collapse_text:
with thead(
onclick="toggle_hash("
f"'table_{PrettyHTMLFormatter.table_number}')",
onclick=f"toggle_hash('table_{PrettyHTMLFormatter.table_number}')",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that got changed because I ran ruff format ...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah please do not change anything else, revert the other changes made by ruff, if it still complains in here I will resolve it on my side.

):
line = tr()
line += th("Text")
Expand Down Expand Up @@ -1336,6 +1333,8 @@ def _str_to_bool(self, value):
"""
Convert string configuration value to boolean.
"""
if isinstance(value, bool):
return value
value_lower = value.lower().strip()
accepted_values = ["true", "false", "yes", "no", "0", "1"]

Expand Down Expand Up @@ -1631,11 +1630,9 @@ def _generate_global_summary(self):
cls=f"feature-summary-container flex-gap {collapse}",
):
with div(cls="feature-summary-stats"):

# Features Status with Filter.
with div("Features: ", cls="feature-summary-row"):
for status in EXPECTED_STATUSES:

# Status counter.
status_counter = feature_statuses.get(status.name.lower(), 0)

Expand Down Expand Up @@ -1664,7 +1661,6 @@ def _generate_global_summary(self):
# Scenarios Status with Filter.
with div("Scenarios: ", cls="feature-summary-row"):
for status in EXPECTED_STATUSES:

# Status counter.
status_counter = scenario_statuses.get(status.name.lower(), 0)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "behave-html-pretty-formatter"
version = "1.16"
version = "1.16.1"
description = "Pretty HTML Formatter for Behave"
readme = "README.md"
license = {file = "LICENSE"}
Expand Down