hardpy 0.15.1__tar.gz → 0.15.2__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 (86) hide show
  1. {hardpy-0.15.1 → hardpy-0.15.2}/PKG-INFO +1 -1
  2. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/__init__.py +2 -0
  3. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/db/schema/v1.py +2 -2
  4. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/plugin.py +7 -2
  5. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/pytest_call.py +15 -14
  6. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/reporter/hook_reporter.py +29 -0
  7. {hardpy-0.15.1 → hardpy-0.15.2}/pyproject.toml +1 -1
  8. {hardpy-0.15.1 → hardpy-0.15.2}/.gitignore +0 -0
  9. {hardpy-0.15.1 → hardpy-0.15.2}/LICENSE +0 -0
  10. {hardpy-0.15.1 → hardpy-0.15.2}/README.md +0 -0
  11. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/cli/__init__.py +0 -0
  12. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/cli/cli.py +0 -0
  13. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/cli/template.py +0 -0
  14. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/common/__init__.py +0 -0
  15. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/common/config.py +0 -0
  16. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/common/stand_cloud/__init__.py +0 -0
  17. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/common/stand_cloud/connector.py +0 -0
  18. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/common/stand_cloud/exception.py +0 -0
  19. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/common/stand_cloud/oauth2.py +0 -0
  20. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/common/stand_cloud/registration.py +0 -0
  21. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/common/stand_cloud/token_manager.py +0 -0
  22. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/common/stand_cloud/utils.py +0 -0
  23. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/__init__.py +0 -0
  24. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/api.py +0 -0
  25. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/allPaths-CV5wjLMB.js +0 -0
  26. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/allPathsLoader-JIzW_pSb.js +0 -0
  27. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-Bfs1BwbR.ttf +0 -0
  28. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-Btb8d-Hu.woff +0 -0
  29. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-CzsyEoPG.svg +0 -0
  30. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-DrH54W_x.woff2 +0 -0
  31. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-RCDSkC4W.eot +0 -0
  32. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-BGGGsqDJ.ttf +0 -0
  33. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-D9WO2FSG.woff2 +0 -0
  34. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-Doom1bSH.eot +0 -0
  35. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-DyVnGNfQ.svg +0 -0
  36. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-ZW-9JnPf.woff +0 -0
  37. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/browser-ponyfill-CccdstaD.js +0 -0
  38. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/index-6RIgWzcZ.js +0 -0
  39. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/index-BMEat_ws.js +0 -0
  40. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/index-BwCQzehg.css +0 -0
  41. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/index-xb4M2ucX.js +0 -0
  42. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/logo_smol-CK3jE85c.png +0 -0
  43. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/assets/splitPathsBySizeLoader-DkZadBcn.js +0 -0
  44. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/favicon.ico +0 -0
  45. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/index.html +0 -0
  46. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/locales/de/translation.json +0 -0
  47. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/locales/en/translation.json +0 -0
  48. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/locales/es/translation.json +0 -0
  49. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/locales/fr/translation.json +0 -0
  50. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/locales/ja/translation.json +0 -0
  51. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/locales/ru/translation.json +0 -0
  52. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/locales/zh/translation.json +0 -0
  53. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/logo192.png +0 -0
  54. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/logo512.png +0 -0
  55. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/hardpy_panel/frontend/dist/manifest.json +0 -0
  56. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/__init__.py +0 -0
  57. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/db/__init__.py +0 -0
  58. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/db/base_connector.py +0 -0
  59. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/db/base_server.py +0 -0
  60. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/db/base_store.py +0 -0
  61. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/db/const.py +0 -0
  62. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/db/runstore.py +0 -0
  63. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/db/schema/__init__.py +0 -0
  64. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/db/statestore.py +0 -0
  65. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/pytest_wrapper.py +0 -0
  66. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/reporter/__init__.py +0 -0
  67. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/reporter/base.py +0 -0
  68. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/reporter/runner_reporter.py +0 -0
  69. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/result/__init__.py +0 -0
  70. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/result/couchdb_config.py +0 -0
  71. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/result/report_loader/__init__.py +0 -0
  72. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/result/report_loader/couchdb_loader.py +0 -0
  73. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/result/report_loader/stand_cloud_loader.py +0 -0
  74. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/result/report_reader/__init__.py +0 -0
  75. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/result/report_reader/couchdb_reader.py +0 -0
  76. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/result/report_reader/stand_cloud_reader.py +0 -0
  77. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/__init__.py +0 -0
  78. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/connection_data.py +0 -0
  79. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/const.py +0 -0
  80. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/dialog_box.py +0 -0
  81. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/exception.py +0 -0
  82. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/machineid.py +0 -0
  83. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/node_info.py +0 -0
  84. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/progress_calculator.py +0 -0
  85. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/singleton.py +0 -0
  86. {hardpy-0.15.1 → hardpy-0.15.2}/hardpy/pytest_hardpy/utils/stand_type.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hardpy
3
- Version: 0.15.1
3
+ Version: 0.15.2
4
4
  Summary: HardPy library for device testing
5
5
  Project-URL: Homepage, https://github.com/everypinio/hardpy/
6
6
  Project-URL: Documentation, https://everypinio.github.io/hardpy/
@@ -49,6 +49,7 @@ from hardpy.pytest_hardpy.utils import (
49
49
  ComparisonOperation,
50
50
  DialogBox,
51
51
  DuplicateParameterError,
52
+ Group,
52
53
  HTMLComponent,
53
54
  ImageComponent,
54
55
  Instrument,
@@ -74,6 +75,7 @@ __all__ = [
74
75
  "DialogBox",
75
76
  "DuplicateParameterError",
76
77
  "ErrorCode",
78
+ "Group",
77
79
  "HTMLComponent",
78
80
  "ImageComponent",
79
81
  "Instrument",
@@ -148,7 +148,7 @@ class NumericMeasurement(IBaseMeasurement):
148
148
 
149
149
  model_config = ConfigDict(extra="forbid")
150
150
 
151
- type: MeasurementType = Field(default=MeasurementType.NUMERIC)
151
+ type: MeasurementType = Field(default=MeasurementType.NUMERIC, frozen=True)
152
152
  value: int | float
153
153
  name: str | None = Field(default=None)
154
154
  unit: str | None = Field(default=None)
@@ -164,7 +164,7 @@ class StringMeasurement(IBaseMeasurement):
164
164
 
165
165
  model_config = ConfigDict(extra="forbid")
166
166
 
167
- type: MeasurementType = Field(default=MeasurementType.STRING)
167
+ type: MeasurementType = Field(default=MeasurementType.STRING, frozen=True)
168
168
  value: str
169
169
  name: str | None = Field(default=None)
170
170
  casesensitive: bool = Field(default=True)
@@ -320,7 +320,7 @@ class HardpyPlugin:
320
320
  attempt = node_info.attempt
321
321
  module_id = node_info.module_id
322
322
  case_id = node_info.case_id
323
- casusd_dut_failure_id = self._reporter.get_caused_dut_failure_id()
323
+ caused_dut_failure_id = self._reporter.get_caused_dut_failure_id()
324
324
  is_dut_failure = True
325
325
 
326
326
  if node_info.critical:
@@ -334,6 +334,7 @@ class HardpyPlugin:
334
334
  self._reporter.set_module_status(module_id, TestStatus.RUN)
335
335
  self._reporter.set_case_status(module_id, case_id, TestStatus.RUN)
336
336
  self._reporter.set_case_attempt(module_id, case_id, current_attempt)
337
+ self._reporter.clear_case_data(module_id, case_id)
337
338
  self._reporter.update_db_by_doc()
338
339
 
339
340
  try:
@@ -342,6 +343,9 @@ class HardpyPlugin:
342
343
  self._is_critical_not_passed = False
343
344
  is_dut_failure = False
344
345
  self._reporter.set_case_status(module_id, case_id, TestStatus.PASSED)
346
+ # clear the error code if there were no failed tests before
347
+ if caused_dut_failure_id is None:
348
+ self._reporter.clear_error_code()
345
349
  break
346
350
  except AssertionError:
347
351
  self._reporter.set_case_status(module_id, case_id, TestStatus.FAILED)
@@ -349,7 +353,8 @@ class HardpyPlugin:
349
353
  if current_attempt == attempt:
350
354
  break
351
355
 
352
- if is_dut_failure and casusd_dut_failure_id is None:
356
+ # set the caused dut failure id only the first time
357
+ if is_dut_failure and caused_dut_failure_id is None:
353
358
  self._reporter.set_caused_dut_failure_id(module_id, case_id)
354
359
 
355
360
  # Reporting hooks
@@ -43,10 +43,17 @@ class CurrentTestInfo:
43
43
  case_id: str
44
44
 
45
45
 
46
- class ErrorCodeMeta(type):
47
- """Error code metaclass."""
46
+ class ErrorCode:
47
+ """Save error code and return error message.
48
+
49
+ It must be called from an assert.
50
+
51
+ Args:
52
+ code (int): error code.
53
+ message (str): error message.
54
+ """
48
55
 
49
- def __call__(cls, code: int, message: str | None = None) -> str | None:
56
+ def __init__(self, code: int, message: str | None = None) -> str | None:
50
57
  """Add error code to document.
51
58
 
52
59
  Args:
@@ -64,19 +71,13 @@ class ErrorCodeMeta(type):
64
71
  if reporter.get_field(key) is None:
65
72
  reporter.set_doc_value(key, code)
66
73
  reporter.update_db_by_doc()
67
- if message: # noqa: RET503
68
- return message
74
+ self._message = message
69
75
 
76
+ def __repr__(self) -> str:
77
+ return self._message
70
78
 
71
- class ErrorCode(metaclass=ErrorCodeMeta):
72
- """Save error code and return error message.
73
-
74
- It must be called from an assert.
75
-
76
- Args:
77
- code (int): error code.
78
- message (str): error message.
79
- """
79
+ def __str__(self) -> str | None:
80
+ return self._message
80
81
 
81
82
 
82
83
  def get_current_report() -> ResultRunStore | None:
@@ -261,6 +261,35 @@ class HookReporter(BaseReporter):
261
261
  key = self.generate_key(DF.CAUSED_DUT_FAILURE_ID)
262
262
  return self._statestore.get_field(key)
263
263
 
264
+ def clear_case_data(self, module_id: str, case_id: str) -> None:
265
+ """Clear test case data.
266
+
267
+ Args:
268
+ module_id (str): module id
269
+ case_id (str): case id
270
+ """
271
+ # fmt: off
272
+ key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.ARTIFACT)
273
+ self.set_doc_value(key, {})
274
+
275
+ key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.MSG)
276
+ self.set_doc_value(key, None)
277
+
278
+ key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.ASSERTION_MSG) # noqa: E501
279
+ self.set_doc_value(key, None)
280
+
281
+ key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.MEASUREMENTS) # noqa: E501
282
+ self.set_doc_value(key, [])
283
+
284
+ key = self.generate_key(DF.MODULES, module_id, DF.CASES, case_id, DF.CHART)
285
+ self.set_doc_value(key, None)
286
+ # fmt: on
287
+
288
+ def clear_error_code(self) -> None:
289
+ """Clear error code."""
290
+ key = self.generate_key(DF.ERROR_CODE)
291
+ self.set_doc_value(key, None)
292
+
264
293
  def update_node_order(self, nodes: dict) -> None:
265
294
  """Update node order.
266
295
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  [project]
5
5
  name = "hardpy"
6
- version = "0.15.1"
6
+ version = "0.15.2"
7
7
  description = "HardPy library for device testing"
8
8
  license = "GPL-3.0-or-later"
9
9
  authors = [{ name = "Everypin", email = "info@everypin.io" }]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes