hardpy 0.6.0__py3-none-any.whl → 0.6.1__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.
hardpy/cli/template.py CHANGED
@@ -137,6 +137,9 @@ log_cli_level = INFO
137
137
  log_cli_format = %%(asctime)s [%%(levelname)s] %%(message)s
138
138
  log_cli_date_format = %H:%M:%S
139
139
  addopts = --hardpy-pt
140
+ --hardpy-db-url http://{}:{}@{}:{}/
141
+ --hardpy-sh {}
142
+ --hardpy-sp {}
140
143
  """
141
144
 
142
145
  test_1_py = """import pytest
@@ -199,7 +202,14 @@ class TemplateGenerator:
199
202
 
200
203
  @property
201
204
  def pytest_ini(self) -> str:
202
- return pytest_ini
205
+ return pytest_ini.format(
206
+ self._config.database.user,
207
+ self._config.database.password,
208
+ self._config.database.host,
209
+ self._config.database.port,
210
+ self._config.socket.host,
211
+ self._config.socket.port,
212
+ )
203
213
 
204
214
  @property
205
215
  def test_1_py(self) -> str: # noqa: WPS114
@@ -1,8 +1,10 @@
1
1
  # Copyright (c) 2024 Everypin
2
2
  # GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
 
4
+ from requests.exceptions import ConnectionError
5
+
4
6
  from pycouchdb.client import Database
5
- from pycouchdb.exceptions import Conflict
7
+ from pycouchdb.exceptions import Conflict, GenericError
6
8
 
7
9
  from hardpy.pytest_hardpy.db.base_server import BaseServer
8
10
 
@@ -22,3 +24,7 @@ class BaseConnector(BaseServer):
22
24
  except Conflict:
23
25
  # database is already created
24
26
  return self._db_srv.database(self._db_name)
27
+ except GenericError as exc:
28
+ raise RuntimeError(f"Error initializing database {exc}") from exc
29
+ except ConnectionError as exc:
30
+ raise RuntimeError(f"Error initializing database: {exc}") from exc
@@ -124,7 +124,10 @@ class HardpyPlugin:
124
124
  config.addinivalue_line("markers", "dependency")
125
125
 
126
126
  # must be init after config data is set
127
- self._reporter = HookReporter(is_clear_statestore)
127
+ try:
128
+ self._reporter = HookReporter(is_clear_statestore)
129
+ except RuntimeError as exc:
130
+ exit(str(exc), 1)
128
131
 
129
132
  def pytest_sessionfinish(self, session: Session, exitstatus: int):
130
133
  """Call at the end of test session."""
@@ -11,7 +11,7 @@ class ConnectionData(Singleton):
11
11
 
12
12
  def __init__(self):
13
13
  if not self._initialized:
14
- self.database_url: str = ""
14
+ self.database_url: str = "http://dev:dev@localhost:5984/"
15
15
  self.socket_host: str = gethostname()
16
16
  self.socket_port: int = 6525
17
17
  self._initialized = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hardpy
3
- Version: 0.6.0
3
+ Version: 0.6.1
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/
@@ -1,7 +1,7 @@
1
1
  hardpy/__init__.py,sha256=1GtlRzkpmNVjZ6LcNYFVmEtgFCR3T6gLSLBLrZA9Nog,1692
2
2
  hardpy/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  hardpy/cli/cli.py,sha256=Z0KGzZplCaHfyttKjMIqnE5upaca-H1XyiaZ2fUCHvM,4504
4
- hardpy/cli/template.py,sha256=E0_IIoj6mJmCIGgTG7fVdS4jMxHoIJqC847GnLPcDNU,6107
4
+ hardpy/cli/template.py,sha256=IgroGdzkKUn5BExDYtzw9djr1Ryvj39wRUF-VlKCToE,6461
5
5
  hardpy/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  hardpy/common/config.py,sha256=rkvbFXFxoqBkYsEbCcnWX5d6G9hzS9Mr4mgQoSMbY6U,4497
7
7
  hardpy/hardpy_panel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -40,11 +40,11 @@ hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-20.afbadb627d43b7
40
40
  hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-20.e857f5a5132b8bfa71a1.woff,sha256=mQZTxE1PyyAL16VWuASOvXlZFwuI4aCPvbrhfgpdIdU,55356
41
41
  hardpy/hardpy_panel/frontend/dist/static/media/logo_smol.5b16f92447a4a9e80331.png,sha256=E4K7drvhJCg9HcTpRihOXZhVJVBZ7-W97Se-3tDb46o,14485
42
42
  hardpy/pytest_hardpy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
- hardpy/pytest_hardpy/plugin.py,sha256=jO264M5JTyQTEmcLhA2B4aW5QXC7HjJ9ovL6KG3rMBE,13961
43
+ hardpy/pytest_hardpy/plugin.py,sha256=5DF29vbTPQ-nohiDDYay6Ml6GUHFnxZZDZHtKSFAOZE,14044
44
44
  hardpy/pytest_hardpy/pytest_call.py,sha256=yXhp40ccOyeN0AJygenjQQ6fQKS2B85eW4-wZP2OgIQ,10184
45
45
  hardpy/pytest_hardpy/pytest_wrapper.py,sha256=p11L4d1VIDmgeG8ltRQrmBRXqK1HRqBCQo63Qia_0SQ,4495
46
46
  hardpy/pytest_hardpy/db/__init__.py,sha256=MxDufncz0zgRAxrndvPXXW4NrU7rRP7MzIrR7S5Cwwo,558
47
- hardpy/pytest_hardpy/db/base_connector.py,sha256=7KUgPY-GmAo8MFN4OFpG5y3WH1xjohRnpeQ1gxQF1tg,751
47
+ hardpy/pytest_hardpy/db/base_connector.py,sha256=cmNV4Y6jFij8Fpp_74W0nqdBFa3J9c9in7MDeNJ4ZL0,1046
48
48
  hardpy/pytest_hardpy/db/base_server.py,sha256=zZbek5jNjtXRVxOhFLWvmKrtOZsbQwrsW0pcql2gpUg,396
49
49
  hardpy/pytest_hardpy/db/base_store.py,sha256=WkgBvvY4pEYp83jP3HxxSfmLztoMzAXh199J_mOQcX8,2900
50
50
  hardpy/pytest_hardpy/db/const.py,sha256=7jmJOZA-V-Jjf8vyFqTuyqrKueiPDUO60jNj2z5jKsQ,738
@@ -62,15 +62,15 @@ hardpy/pytest_hardpy/result/report_loader/couchdb_loader.py,sha256=Wwo_JBoPpwh72
62
62
  hardpy/pytest_hardpy/result/report_reader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
63
  hardpy/pytest_hardpy/result/report_reader/couchdb_reader.py,sha256=Ns82mzerDa4HipX6Xea1uGkXmhf8UotX6KsiChD1ViM,5618
64
64
  hardpy/pytest_hardpy/utils/__init__.py,sha256=R2a5la6zEQdEeeL-W-OWpAFFzXHswu8a_nAw3C53y38,1295
65
- hardpy/pytest_hardpy/utils/connection_data.py,sha256=IU8YYwVQQHfKW_HSmSvcd5BohW34BWJVZZ8uyUVJA9c,511
65
+ hardpy/pytest_hardpy/utils/connection_data.py,sha256=GTKXzl9MXt1XkwEPi6NxdWUghRmZOWBV8nfgnbRh50s,541
66
66
  hardpy/pytest_hardpy/utils/const.py,sha256=SsqRisrq9OlCb9cK5sEjFW_bZ9V2Qw61P9iYObIj5Fg,423
67
67
  hardpy/pytest_hardpy/utils/dialog_box.py,sha256=lY_q_SGRdWtza4paHrsMfKTCsSkN_V8WIH7V7r_PNdo,8187
68
68
  hardpy/pytest_hardpy/utils/exception.py,sha256=BlkVea4wwHJeXcU1rpUqH9IbMBFQYHghOXhHWSvDz8Q,1156
69
69
  hardpy/pytest_hardpy/utils/node_info.py,sha256=qBzNCv-0YwIcLxES3kIvOLSblaJ3ICrtKl-tdF2Ndnk,3149
70
70
  hardpy/pytest_hardpy/utils/progress_calculator.py,sha256=L6jJgkO1uxx5U2KKmQfTsGwgX5Atrqka5KV7uiMcou8,1033
71
71
  hardpy/pytest_hardpy/utils/singleton.py,sha256=vP1BMzLkQF0j7t7crijPj6uyAowfviihJeXDJvhTDxU,606
72
- hardpy-0.6.0.dist-info/METADATA,sha256=XFyXgb4G7pYJMZbtwoNdb-yzs2yS3rOt-HMd7kFM5lY,3586
73
- hardpy-0.6.0.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
74
- hardpy-0.6.0.dist-info/entry_points.txt,sha256=nL2sMkKMScNaOE0IPkYnu9Yr-BUswZvGSrwY-SxHY3E,102
75
- hardpy-0.6.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
76
- hardpy-0.6.0.dist-info/RECORD,,
72
+ hardpy-0.6.1.dist-info/METADATA,sha256=HtkFMKxgEnDfNOSz8C-CQcyGYAyF_kmF2fAJM7MfcVI,3586
73
+ hardpy-0.6.1.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
74
+ hardpy-0.6.1.dist-info/entry_points.txt,sha256=nL2sMkKMScNaOE0IPkYnu9Yr-BUswZvGSrwY-SxHY3E,102
75
+ hardpy-0.6.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
76
+ hardpy-0.6.1.dist-info/RECORD,,
File without changes