pytest-json-ctrf 0.3.7__tar.gz → 0.4.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.3.7 → pytest_json_ctrf-0.4.1}/PKG-INFO +2 -2
  2. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/ctrf/Report.py +2 -2
  3. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/ctrf/TestObject.py +16 -16
  4. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/pyproject.toml +8 -2
  5. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/pytest_json_ctrf.egg-info/PKG-INFO +2 -2
  6. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/README.md +0 -0
  7. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/ctrf/BaseMetadataReport.py +0 -0
  8. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/ctrf/CommonTestReportPlugin.py +0 -0
  9. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/ctrf/__init__.py +0 -0
  10. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/ctrf/main.py +0 -0
  11. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/pytest_json_ctrf.egg-info/SOURCES.txt +0 -0
  12. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/pytest_json_ctrf.egg-info/dependency_links.txt +0 -0
  13. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/pytest_json_ctrf.egg-info/entry_points.txt +0 -0
  14. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/pytest_json_ctrf.egg-info/requires.txt +0 -0
  15. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/pytest_json_ctrf.egg-info/top_level.txt +0 -0
  16. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/setup.cfg +0 -0
  17. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/tests/test_example.py +0 -0
  18. {pytest_json_ctrf-0.3.7 → pytest_json_ctrf-0.4.1}/tests/test_plugin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-json-ctrf
3
- Version: 0.3.7
3
+ Version: 0.4.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/
@@ -9,7 +9,7 @@ Classifier: Framework :: Pytest
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.9
12
+ Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  Requires-Dist: pytest>6.0.0
15
15
 
@@ -16,10 +16,10 @@ class Report:
16
16
  self.stop_time = None
17
17
 
18
18
  def start(self) -> None:
19
- self.start_time = self.start_time = int(time.time() * 1000)
19
+ self.start_time = int(time.time() * 1000)
20
20
 
21
21
  def stop(self) -> None:
22
- self.stop_time = self.start_time = int(time.time() * 1000)
22
+ self.stop_time = int(time.time() * 1000)
23
23
 
24
24
  @staticmethod
25
25
  def _get_tool() -> dict:
@@ -1,5 +1,5 @@
1
1
  from enum import Enum
2
- from typing import Any
2
+ from typing import Any, Optional, List, Dict
3
3
 
4
4
  from pytest import TestReport
5
5
 
@@ -15,20 +15,20 @@ class TestStatus(Enum):
15
15
  class TestObject:
16
16
  name: str
17
17
  _status: TestStatus
18
- raw_status: str
19
- duration: float = 0
20
- start: float
21
- stop: float
18
+ raw_status: Optional[str]
19
+ duration: int = 0
20
+ start: int
21
+ stop: int
22
22
  retries: int
23
- message: str
23
+ message: Optional[str]
24
24
 
25
- worker_id: str
25
+ worker_id: Optional[str]
26
26
  file_path: str
27
- tags: list[str]
28
- browser: str
29
- trace: str
27
+ tags: List[str]
28
+ browser: Optional[str]
29
+ trace: Optional[str]
30
30
 
31
- def __init__(self, report: TestReport, worker_id: str or None = None):
31
+ def __init__(self, report: TestReport, worker_id: Optional[str] = None):
32
32
  self.name = report.nodeid.split('[')[0]
33
33
  self._status = TestStatus.PENDING
34
34
  self._status = self.set_status(report)
@@ -41,7 +41,7 @@ class TestObject:
41
41
 
42
42
  self.worker_id = worker_id
43
43
  self.file_path = report.location[0]
44
- self.tags = []
44
+ self.tags: List[str] = []
45
45
  self.browser = None
46
46
  self.trace = None
47
47
 
@@ -79,11 +79,11 @@ class TestObject:
79
79
 
80
80
  def update(self, report: TestReport) -> None:
81
81
  self.set_status(report)
82
- self.duration += 1000 * report.duration # pytest reports duration in seconds, CTRF requires milliseconds
83
82
  if report.when == "setup" and self.start == 0:
84
- self.start = report.start
83
+ self.start = int(report.start * 1000)
85
84
  if report.when == "teardown" and self.stop == 0:
86
- self.stop = report.stop
85
+ self.stop = int(report.stop * 1000)
86
+ self.duration = self.stop - self.start
87
87
  if report.longrepr and len(report.longreprtext) > 0:
88
88
  self.trace = report.longreprtext
89
89
  if hasattr(report, '_ctrf_metadata'):
@@ -91,7 +91,7 @@ class TestObject:
91
91
  self.browser = report._ctrf_metadata.get('browser')
92
92
 
93
93
  def serialize(self) -> dict:
94
- result: dict[str, Any] = {
94
+ result: Dict[str, Any] = {
95
95
  'name': self.name,
96
96
  'status': self._status.value,
97
97
  'raw_status': self.raw_status,
@@ -10,7 +10,7 @@ exclude = [
10
10
 
11
11
  [project]
12
12
  name = "pytest-json-ctrf"
13
- version = "0.3.7"
13
+ version = "0.4.1"
14
14
 
15
15
  dependencies = [
16
16
  "pytest>6.0.0",
@@ -21,7 +21,7 @@ authors = [
21
21
  ]
22
22
  description = "Pytest plugin to generate json report in CTRF (Common Test Report Format)"
23
23
  readme = "README.md"
24
- requires-python = ">=3.9"
24
+ requires-python = ">=3.8"
25
25
  classifiers = [
26
26
  "Framework :: Pytest",
27
27
  "Programming Language :: Python :: 3",
@@ -41,3 +41,9 @@ markers = [
41
41
 
42
42
  [project.entry-points.pytest11]
43
43
  ctrf = "ctrf.main"
44
+
45
+ [tool.uv]
46
+ dev-dependencies = [
47
+ "pytest-xdist>=2.0.0",
48
+ ]
49
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-json-ctrf
3
- Version: 0.3.7
3
+ Version: 0.4.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/
@@ -9,7 +9,7 @@ Classifier: Framework :: Pytest
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.9
12
+ Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  Requires-Dist: pytest>6.0.0
15
15