pytestomatio 2.8.2.dev19__tar.gz → 2.8.2.dev21__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 (40) hide show
  1. {pytestomatio-2.8.2.dev19/pytestomatio.egg-info → pytestomatio-2.8.2.dev21}/PKG-INFO +1 -1
  2. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pyproject.toml +1 -1
  3. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/connect/connector.py +24 -9
  4. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21/pytestomatio.egg-info}/PKG-INFO +1 -1
  5. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/LICENSE +0 -0
  6. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/README.md +0 -0
  7. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/__init__.py +0 -0
  8. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/connect/__init__.py +0 -0
  9. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/connect/s3_connector.py +0 -0
  10. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/decor/__init__.py +0 -0
  11. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/decor/decorator_updater.py +0 -0
  12. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/decor/default.py +0 -0
  13. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/decor/pep8.py +0 -0
  14. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/main.py +0 -0
  15. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/testing/__init__.py +0 -0
  16. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/testing/code_collector.py +0 -0
  17. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/testing/testItem.py +0 -0
  18. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/testomatio/__init__.py +0 -0
  19. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/testomatio/testRunConfig.py +0 -0
  20. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/testomatio/testomat_item.py +0 -0
  21. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/testomatio/testomatio.py +0 -0
  22. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/utils/__init__.py +0 -0
  23. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/utils/helper.py +0 -0
  24. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/utils/parser_setup.py +0 -0
  25. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio/utils/validations.py +0 -0
  26. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio.egg-info/SOURCES.txt +0 -0
  27. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio.egg-info/dependency_links.txt +0 -0
  28. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio.egg-info/entry_points.txt +0 -0
  29. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio.egg-info/requires.txt +0 -0
  30. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/pytestomatio.egg-info/top_level.txt +0 -0
  31. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/setup.cfg +0 -0
  32. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/tests/sub/__init__.py +0 -0
  33. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/tests/sub/sub_mob/__init__.py +0 -0
  34. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/tests/sub/sub_mob/sub_sub_class_test.py +0 -0
  35. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/tests/sub/sub_mob/sub_sub_test.py +0 -0
  36. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/tests/sub/test_class_sub.py +0 -0
  37. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/tests/sub/test_sub.py +0 -0
  38. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/tests/test_class_root.py +0 -0
  39. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/tests/test_decorators.py +0 -0
  40. {pytestomatio-2.8.2.dev19 → pytestomatio-2.8.2.dev21}/tests/test_root.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytestomatio
3
- Version: 2.8.2.dev19
3
+ Version: 2.8.2.dev21
4
4
  Summary: Pytest plugin to sync test with testomat.io
5
5
  Author: Oleksii Ostapov, TikoQA
6
6
  Project-URL: Testomat.io, https://testomat.io/
@@ -13,7 +13,7 @@ version_provider = "pep621"
13
13
  update_changelog_on_bump = false
14
14
  [project]
15
15
  name = "pytestomatio"
16
- version = "2.8.2.dev19"
16
+ version = "2.8.2.dev21"
17
17
 
18
18
  dependencies = [
19
19
  "requests>=2.29.0",
@@ -12,11 +12,26 @@ log = logging.getLogger('pytestomatio')
12
12
  class Connector:
13
13
  def __init__(self, base_url: str = 'https://app.testomat.io', api_key: str = None):
14
14
  self.base_url = base_url
15
- self.session = requests.Session()
16
- self.session.verify = True
15
+ self._session = requests.Session()
17
16
  self.jwt: str = ''
18
17
  self.api_key = api_key
19
18
 
19
+ @property
20
+ def _session(self):
21
+ """Resolve and apply proxy settings each time session is accessed."""
22
+ if self._session is None:
23
+ self._session = requests.Session()
24
+
25
+ http_proxy = getenv("HTTP_PROXY")
26
+ if http_proxy:
27
+ self._session.proxies = {"http": http_proxy, "https": http_proxy}
28
+ self._session.verify = False
29
+ else:
30
+ self._session.proxies.clear()
31
+ self._session.verify = True
32
+
33
+ return self._session
34
+
20
35
  def load_tests(
21
36
  self,
22
37
  tests: list[TestItem],
@@ -49,7 +64,7 @@ class Connector:
49
64
  })
50
65
 
51
66
  try:
52
- response = self.session.post(f'{self.base_url}/api/load?api_key={self.api_key}', json=request)
67
+ response = self._session.post(f'{self.base_url}/api/load?api_key={self.api_key}', json=request)
53
68
  except ConnectionError:
54
69
  log.error(f'Failed to connect to {self.base_url}')
55
70
  return
@@ -67,7 +82,7 @@ class Connector:
67
82
 
68
83
  def get_tests(self, test_metadata: list[TestItem]) -> dict:
69
84
  # with safe_request('Failed to get test ids from testomat.io'):
70
- response = self.session.get(f'{self.base_url}/api/test_data?api_key={self.api_key}')
85
+ response = self._session.get(f'{self.base_url}/api/test_data?api_key={self.api_key}')
71
86
  return response.json()
72
87
 
73
88
  def create_test_run(self, title: str, group_title, env: str, label: str, shared_run: bool, parallel, ci_build_url: str) -> dict | None:
@@ -83,7 +98,7 @@ class Connector:
83
98
  }
84
99
  filtered_request = {k: v for k, v in request.items() if v is not None}
85
100
  try:
86
- response = self.session.post(f'{self.base_url}/api/reporter', json=filtered_request)
101
+ response = self._session.post(f'{self.base_url}/api/reporter', json=filtered_request)
87
102
  except ConnectionError:
88
103
  log.error(f'Failed to connect to {self.base_url}')
89
104
  return
@@ -113,7 +128,7 @@ class Connector:
113
128
  filtered_request = {k: v for k, v in request.items() if v is not None}
114
129
 
115
130
  try:
116
- response = self.session.put(f'{self.base_url}/api/reporter/{id}', json=filtered_request)
131
+ response = self._session.put(f'{self.base_url}/api/reporter/{id}', json=filtered_request)
117
132
  except ConnectionError as ce:
118
133
  log.error(f'Failed to connect to {self.base_url}: {ce}')
119
134
  return
@@ -158,7 +173,7 @@ class Connector:
158
173
  }
159
174
  filtered_request = {k: v for k, v in request.items() if v is not None}
160
175
  try:
161
- response = self.session.post(f'{self.base_url}/api/reporter/{run_id}/testrun?api_key={self.api_key}',
176
+ response = self._session.post(f'{self.base_url}/api/reporter/{run_id}/testrun?api_key={self.api_key}',
162
177
  json=filtered_request)
163
178
  except ConnectionError:
164
179
  log.error(f'Failed to connect to {self.base_url}')
@@ -176,7 +191,7 @@ class Connector:
176
191
  def finish_test_run(self, run_id: str, is_final=False) -> None:
177
192
  status_event = 'finish_parallel' if is_final else 'finish'
178
193
  try:
179
- self.session.put(f'{self.base_url}/api/reporter/{run_id}?api_key={self.api_key}',
194
+ self._session.put(f'{self.base_url}/api/reporter/{run_id}?api_key={self.api_key}',
180
195
  json={"status_event": status_event})
181
196
  except ConnectionError:
182
197
  log.error(f'Failed to connect to {self.base_url}')
@@ -189,4 +204,4 @@ class Connector:
189
204
  return
190
205
 
191
206
  def disconnect(self):
192
- self.session.close()
207
+ self._session.close()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytestomatio
3
- Version: 2.8.2.dev19
3
+ Version: 2.8.2.dev21
4
4
  Summary: Pytest plugin to sync test with testomat.io
5
5
  Author: Oleksii Ostapov, TikoQA
6
6
  Project-URL: Testomat.io, https://testomat.io/