pytest-html-plus 0.4.7__py3-none-any.whl → 0.4.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,8 @@ from pytest_html_plus.utils import is_main_worker, get_env_marker, get_report_ti
8
8
  def write_plus_metadata_if_main_worker(config, report_path, output_path="plus_metadata.json", **kwargs):
9
9
  if not is_main_worker():
10
10
  return
11
- branch = kwargs.get("git_branch", "NA")
12
- commit = kwargs.get("git_commit", "NA")
11
+ branch = kwargs.get("git_branch", "Pass --git-branch to populate git metadata")
12
+ commit = kwargs.get("git_commit", "Pass --git-commit to populate git metadata")
13
13
  metadata = {
14
14
  "report_title": get_report_title(output_path=report_path),
15
15
  "environment": get_env_marker(config),
@@ -184,8 +184,8 @@ class JSONReporter:
184
184
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
185
185
  <style>
186
186
 
187
- body {{ font-family: Arial, sans-serif; padding: 1rem; background: #f9f9f9; }}
188
- .test {{ border: 1px solid #ddd; margin-bottom: 0.5rem; border-radius: 5px; background: white; }}
187
+ body {{ font-family: Arial, sans-serif; padding: 1rem; background: #f2f4f7; }}
188
+ .test {{ border: 1px solid #ddd; margin-bottom: 0.5rem; border-radius: 5px; background: #ffffff; }}
189
189
  .header {{ padding: 0.5rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }}
190
190
  .header.passed {{ background: #e6f4ea; color: #2f7a33; }}
191
191
  .header.failed {{ background: #fdecea; color: #a83232; }}
@@ -293,6 +293,13 @@ class JSONReporter:
293
293
  width: 100%;
294
294
  border-collapse: collapse;
295
295
  }}
296
+
297
+ .muted-hint code {{
298
+ background: #f1f5f9;
299
+ padding: 2px 4px;
300
+ border-radius: 4px;
301
+ font-size: 0.9em;
302
+ }}
296
303
 
297
304
  .report-metadata th, .report-metadata td {{
298
305
  text-align: left;
@@ -587,8 +594,8 @@ class JSONReporter:
587
594
  </script>
588
595
  </head>
589
596
  <body>
590
- <div class="report-metadata">
591
- <h2 onclick="this.nextElementSibling.classList.toggle('hidden')" style="cursor: pointer; font-size: 12px;">
597
+ <div class="report-metadata" style="background: #f2f4f7;">
598
+ <h2 onclick="this.nextElementSibling.classList.toggle('hidden')" style="cursor: pointer; font-size: 12px; ">
592
599
  Execution Metadata (click to toggle)
593
600
  {self.generate_copy_button(self.metadata, "metadata")}
594
601
  </h2>
@@ -683,9 +690,21 @@ class JSONReporter:
683
690
 
684
691
  # Add checkboxes for all markers
685
692
  marker_counts = self.filters.get("marker_counts", {})
686
- for marker in sorted(marker_counts):
687
- count = marker_counts[marker]
688
- html += f'<label><input type="checkbox" value="{marker}" /> {marker} ({count})</label> '
693
+ if not marker_counts:
694
+ html += (
695
+ '<span class="muted-hint">'
696
+ 'Use <code>pytest.mark.*</code> to enable marker filters'
697
+ '</span>'
698
+ )
699
+ else:
700
+ for marker in sorted(marker_counts):
701
+ count = marker_counts[marker]
702
+ html += (
703
+ f'<label>'
704
+ f'<input type="checkbox" value="{marker}" /> '
705
+ f'{marker} ({count})'
706
+ f'</label> '
707
+ )
689
708
 
690
709
  html += '<div id="tests-container">'
691
710
 
@@ -177,8 +177,8 @@ def pytest_sessionfinish(session, exitstatus):
177
177
 
178
178
  def pytest_sessionstart(session):
179
179
  html_output = session.config.getoption("--html-output") or "report_output"
180
- git_branch = session.config.getoption("--git-branch") or "NA"
181
- git_commit = session.config.getoption("--git-commit") or "NA"
180
+ git_branch = session.config.getoption("--git-branch") or "Pass --git-branch to populate git metadata"
181
+ git_commit = session.config.getoption("--git-commit") or "Pass --git-commit to populate git metadata"
182
182
  configure_logging()
183
183
  session.config.addinivalue_line(
184
184
  "markers", "link(url): Add a link to external test case or documentation."
@@ -242,13 +242,25 @@ def pytest_addoption(parser):
242
242
  parser.addoption(
243
243
  "--git-branch",
244
244
  action="store",
245
- default="NA",
245
+ default="Pass --git-branch to populate git metadata",
246
246
  help="Helps show branch information on the report"
247
247
  )
248
248
  parser.addoption(
249
249
  "--git-commit",
250
250
  action="store",
251
- default="NA",
251
+ default="Pass --git-commit to populate git metadata",
252
+ help="Helps show commitId information on the report"
253
+ )
254
+ parser.addoption(
255
+ "--env",
256
+ action="store",
257
+ default="Pass --env or --environment <name> to populate environment",
258
+ help="Helps show commitId information on the report"
259
+ )
260
+ parser.addoption(
261
+ "--environment",
262
+ action="store",
263
+ default="Pass --env or --environment <name> to populate environment",
252
264
  help="Helps show commitId information on the report"
253
265
  )
254
266
 
pytest_html_plus/utils.py CHANGED
@@ -7,7 +7,7 @@ def get_env_marker(config):
7
7
  for arg in ("--env", "--environment"):
8
8
  if config.getoption(arg.lstrip("-").replace("-", "_"), default=None):
9
9
  return config.getoption(arg.lstrip("-").replace("-", "_"))
10
- return "NA"
10
+ return "Pass --env <name> to populate environment"
11
11
 
12
12
  def get_report_title(output_path):
13
13
  report_path = output_path
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pytest-html-plus
3
- Version: 0.4.7
4
- Summary: Generate Actionable, automatic screenshots, unified Pytest HTML report in less than 3 seconds — no hooks, merge plugins, no config, xdist-ready.
3
+ Version: 0.4.8
4
+ Summary: Generate Actionable, automatic screenshots, unified Mobile friendly Pytest HTML report in less than 3 seconds — no hooks, merge plugins, no config, xdist-ready.
5
5
  License: MIT
6
6
  Keywords: pytest,pytest-html-plus,pytest-plugin,html-test-report,beautiful-test-report,shareable-test-results,test-report,test-results,unit-test-report,functional-test-report,test-summary,reporting,python-testing,automated-testing,test-runner,report-generator,continuous-integration,ci-cd,github-actions,jenkins,pytest-html,pytest-report
7
7
  Author: reporterplus
@@ -1,16 +1,16 @@
1
1
  pytest_html_plus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  pytest_html_plus/compute_filter_counts.py,sha256=FznjPos-bgYSi8bERG_WbaZWMQDIAfoYP4QTRbe8vHw,963
3
- pytest_html_plus/compute_report_metadata.py,sha256=k35kCSCAc8Fj9zgzzM49kh0h1NV2Ope9Lr8JHG_1jlU,783
3
+ pytest_html_plus/compute_report_metadata.py,sha256=OR3MLLg2yZD2H4KRdogv7EiB2zKE4fHFafNfSK4NU2U,863
4
4
  pytest_html_plus/extract_link.py,sha256=1XtqkbZkrl1YgPGtFc3Ss1XFWm4LNLuO3Hi407HNChk,340
5
- pytest_html_plus/generate_html_report.py,sha256=d7KHgwZ9BolItvk0sBzD4wWUA2-fJ56c49RxMmzLQII,36655
5
+ pytest_html_plus/generate_html_report.py,sha256=Q-2jbFyUYfwKwncMWrKybytLLnPptOzb5zdq_CwqSEI,37152
6
6
  pytest_html_plus/json_merge.py,sha256=EQu23n8z4a0FxvFOlvYoDlX1jrZYjWwsCL-6oxfDREw,1868
7
7
  pytest_html_plus/json_to_xml_converter.py,sha256=5E6BGMw4FaJhoYDUZQ6dF8NWqAeXrcuSrlySy81IrVE,3468
8
- pytest_html_plus/plugin.py,sha256=u9CEf-A6W39LS3I5XulK3joRP87p_zQ7NK32mi-LkKs,11957
8
+ pytest_html_plus/plugin.py,sha256=NbvC4SvJ6AxO1g5-l_i-e2hRmobHd5FrIHg2DqRxvlM,12529
9
9
  pytest_html_plus/resolver_driver.py,sha256=hehokRO5EuG4Ti8MyaSBW4xaHduUK3Ot2jbw1YpIsnk,1287
10
10
  pytest_html_plus/send_email_report.py,sha256=qDnAPy1Jc4favOvXg6MT0ttNmSsG3MXGQX1Hu7wN1Go,2622
11
- pytest_html_plus/utils.py,sha256=DkGzQDFG_SUQHo97_lBnqTyeNxlo3NlFBZ2X_ooZRdM,2205
12
- pytest_html_plus-0.4.7.dist-info/LICENSE,sha256=8flU0ghLnuKK8qZv9pJ1xhXiKQdUncg0OvqMwYhGWzY,1090
13
- pytest_html_plus-0.4.7.dist-info/METADATA,sha256=DOh06HMYRkIYFzmNJiWaQQXleQyb3-yBbZ5ZDiiNL2s,8504
14
- pytest_html_plus-0.4.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
15
- pytest_html_plus-0.4.7.dist-info/entry_points.txt,sha256=eSbV9G_n_XnR4wemMxKHSSuPMcBSoHbE1WuC2IQp4Zk,53
16
- pytest_html_plus-0.4.7.dist-info/RECORD,,
11
+ pytest_html_plus/utils.py,sha256=Qa34fOmZ6uWlIGG6hyoLWG1LIX1O9HFCtjWOtn03gSs,2244
12
+ pytest_html_plus-0.4.8.dist-info/LICENSE,sha256=8flU0ghLnuKK8qZv9pJ1xhXiKQdUncg0OvqMwYhGWzY,1090
13
+ pytest_html_plus-0.4.8.dist-info/METADATA,sha256=w7klAQr0fMiLB7LO7H0mxpfGAHD1mfwgcsyDm_a1V68,8520
14
+ pytest_html_plus-0.4.8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
15
+ pytest_html_plus-0.4.8.dist-info/entry_points.txt,sha256=eSbV9G_n_XnR4wemMxKHSSuPMcBSoHbE1WuC2IQp4Zk,53
16
+ pytest_html_plus-0.4.8.dist-info/RECORD,,