pytest-json-ctrf 0.4.1__tar.gz → 0.5.1__tar.gz

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.
Files changed (18) hide show
  1. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/PKG-INFO +9 -1
  2. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/README.md +8 -0
  3. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/ctrf/Report.py +13 -7
  4. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/pyproject.toml +1 -1
  5. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/pytest_json_ctrf.egg-info/PKG-INFO +9 -1
  6. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/tests/test_plugin.py +4 -4
  7. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/ctrf/BaseMetadataReport.py +0 -0
  8. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/ctrf/CommonTestReportPlugin.py +0 -0
  9. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/ctrf/TestObject.py +0 -0
  10. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/ctrf/__init__.py +0 -0
  11. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/ctrf/main.py +0 -0
  12. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/pytest_json_ctrf.egg-info/SOURCES.txt +0 -0
  13. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/pytest_json_ctrf.egg-info/dependency_links.txt +0 -0
  14. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/pytest_json_ctrf.egg-info/entry_points.txt +0 -0
  15. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/pytest_json_ctrf.egg-info/requires.txt +0 -0
  16. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/pytest_json_ctrf.egg-info/top_level.txt +0 -0
  17. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/setup.cfg +0 -0
  18. {pytest_json_ctrf-0.4.1 → pytest_json_ctrf-0.5.1}/tests/test_example.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-json-ctrf
3
- Version: 0.4.1
3
+ Version: 0.5.1
4
4
  Summary: Pytest plugin to generate json report in CTRF (Common Test Report Format)
5
5
  Author: Oleksii Ostapov
6
6
  Project-URL: Infopulse, https://infopulse.com/
@@ -54,6 +54,9 @@ More info here: https://ctrf.io/docs/schema/examples
54
54
 
55
55
  ```json
56
56
  {
57
+ "reportFormat": "CTRF",
58
+ "specVersion": "0.0.0",
59
+ "generatedBy": "pytest",
57
60
  "results": {
58
61
  "tool": {
59
62
  "name": "jest"
@@ -110,6 +113,11 @@ The `pytest_runtest_logreport` hook in the controller node is used to collect th
110
113
  - https://github.com/testomatio/pytestomatio -> Source of inspiration for creating pytest plugins
111
114
  - https://github.com/infopulse/Playwright-course-python -> The report will be used in the demo project as +1 report option
112
115
 
116
+ ## Changelog
117
+ - 0.5.1 - added mandatory root object fields: reportFormat, specVersion, generatedBy
118
+ - 0.5.0 - Changed logic of handling parametrized tests. Previously they were marked as retries, now they are reported as separate tests
119
+ - 0.4.1 - Introduced backward compatibility with python 3.8, fixed issues with the time formats
120
+
113
121
  ### Roadmap
114
122
  - Add screenshots handling
115
123
  - Add hooks for the report extension
@@ -39,6 +39,9 @@ More info here: https://ctrf.io/docs/schema/examples
39
39
 
40
40
  ```json
41
41
  {
42
+ "reportFormat": "CTRF",
43
+ "specVersion": "0.0.0",
44
+ "generatedBy": "pytest",
42
45
  "results": {
43
46
  "tool": {
44
47
  "name": "jest"
@@ -95,6 +98,11 @@ The `pytest_runtest_logreport` hook in the controller node is used to collect th
95
98
  - https://github.com/testomatio/pytestomatio -> Source of inspiration for creating pytest plugins
96
99
  - https://github.com/infopulse/Playwright-course-python -> The report will be used in the demo project as +1 report option
97
100
 
101
+ ## Changelog
102
+ - 0.5.1 - added mandatory root object fields: reportFormat, specVersion, generatedBy
103
+ - 0.5.0 - Changed logic of handling parametrized tests. Previously they were marked as retries, now they are reported as separate tests
104
+ - 0.4.1 - Introduced backward compatibility with python 3.8, fixed issues with the time formats
105
+
98
106
  ### Roadmap
99
107
  - Add screenshots handling
100
108
  - Add hooks for the report extension
@@ -3,6 +3,7 @@ import pytest
3
3
  import time
4
4
  import json
5
5
  from typing import Optional
6
+ from datetime import datetime, timezone
6
7
  from pytest import TestReport
7
8
  from collections import OrderedDict
8
9
  from .TestObject import TestObject, TestStatus
@@ -62,7 +63,7 @@ class Report:
62
63
 
63
64
  def process_retries(self) -> None:
64
65
  for test_id, test_data in self.test_items.items():
65
- name = test_id.split('[')[0]
66
+ name = str(test_id)
66
67
  test: Optional[TestObject] = self.prepared_tests.get(name)
67
68
  if test:
68
69
  test.status = test_data.status
@@ -78,12 +79,17 @@ class Report:
78
79
 
79
80
  def get_report(self) -> dict:
80
81
  self.process_retries()
81
- return {'results': {
82
- "tool": self._get_tool(),
83
- "summary": self._get_summary(),
84
- "environment": self._get_environment(),
85
- "tests": [test.serialize() for test in self.prepared_tests.values()]
86
- }
82
+ return {
83
+ 'reportFormat': 'CTRF',
84
+ 'specVersion': '0.0.0',
85
+ 'timestamp': datetime.now(timezone.utc).isoformat(),
86
+ 'generatedBy': 'pytest',
87
+ 'results': {
88
+ "tool": self._get_tool(),
89
+ "summary": self._get_summary(),
90
+ "environment": self._get_environment(),
91
+ "tests": [test.serialize() for test in self.prepared_tests.values()]
92
+ }
87
93
  }
88
94
 
89
95
  def save(self, report_file: str) -> None:
@@ -10,7 +10,7 @@ exclude = [
10
10
 
11
11
  [project]
12
12
  name = "pytest-json-ctrf"
13
- version = "0.4.1"
13
+ version = "0.5.1"
14
14
 
15
15
  dependencies = [
16
16
  "pytest>6.0.0",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-json-ctrf
3
- Version: 0.4.1
3
+ Version: 0.5.1
4
4
  Summary: Pytest plugin to generate json report in CTRF (Common Test Report Format)
5
5
  Author: Oleksii Ostapov
6
6
  Project-URL: Infopulse, https://infopulse.com/
@@ -54,6 +54,9 @@ More info here: https://ctrf.io/docs/schema/examples
54
54
 
55
55
  ```json
56
56
  {
57
+ "reportFormat": "CTRF",
58
+ "specVersion": "0.0.0",
59
+ "generatedBy": "pytest",
57
60
  "results": {
58
61
  "tool": {
59
62
  "name": "jest"
@@ -110,6 +113,11 @@ The `pytest_runtest_logreport` hook in the controller node is used to collect th
110
113
  - https://github.com/testomatio/pytestomatio -> Source of inspiration for creating pytest plugins
111
114
  - https://github.com/infopulse/Playwright-course-python -> The report will be used in the demo project as +1 report option
112
115
 
116
+ ## Changelog
117
+ - 0.5.1 - added mandatory root object fields: reportFormat, specVersion, generatedBy
118
+ - 0.5.0 - Changed logic of handling parametrized tests. Previously they were marked as retries, now they are reported as separate tests
119
+ - 0.4.1 - Introduced backward compatibility with python 3.8, fixed issues with the time formats
120
+
113
121
  ### Roadmap
114
122
  - Add screenshots handling
115
123
  - Add hooks for the report extension
@@ -48,8 +48,8 @@ def test_with_markers(pytester: Pytester):
48
48
 
49
49
 
50
50
  def test_with_plugin_no_xdist(ctrf_report_sync):
51
- assert ctrf_report_sync["results"]["summary"]["tests"] == 12
52
- assert ctrf_report_sync["results"]["summary"]["passed"] == 6
51
+ assert ctrf_report_sync["results"]["summary"]["tests"] == 20
52
+ assert ctrf_report_sync["results"]["summary"]["passed"] == 14
53
53
  assert ctrf_report_sync["results"]["summary"]["failed"] == 5
54
54
  assert ctrf_report_sync["results"]["summary"]["skipped"] == 1
55
55
 
@@ -70,8 +70,8 @@ def test_any_test_has_timestamps(ctrf_report_sync):
70
70
 
71
71
 
72
72
  def test_with_plugin_with_xdist(ctrf_report_xdist):
73
- assert ctrf_report_xdist["results"]["summary"]["tests"] == 12
74
- assert ctrf_report_xdist["results"]["summary"]["passed"] == 6
73
+ assert ctrf_report_xdist["results"]["summary"]["tests"] == 20
74
+ assert ctrf_report_xdist["results"]["summary"]["passed"] == 14
75
75
  assert ctrf_report_xdist["results"]["summary"]["failed"] == 5
76
76
  assert ctrf_report_xdist["results"]["summary"]["skipped"] == 1
77
77