testit-adapter-pytest 3.3.2__tar.gz → 3.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 (21) hide show
  1. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/PKG-INFO +15 -4
  2. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/README.md +3 -1
  3. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/setup.py +2 -2
  4. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest/listener.py +22 -32
  5. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest/plugin.py +13 -1
  6. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest.egg-info/PKG-INFO +15 -4
  7. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest.egg-info/SOURCES.txt +1 -4
  8. testit_adapter_pytest-3.4.1/src/testit_adapter_pytest.egg-info/requires.txt +4 -0
  9. testit_adapter_pytest-3.3.2/src/testit_adapter_pytest/fixture_manager.py +0 -60
  10. testit_adapter_pytest-3.3.2/src/testit_adapter_pytest/fixture_storage.py +0 -40
  11. testit_adapter_pytest-3.3.2/src/testit_adapter_pytest/models/fixture.py +0 -24
  12. testit_adapter_pytest-3.3.2/src/testit_adapter_pytest.egg-info/requires.txt +0 -4
  13. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/setup.cfg +0 -0
  14. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest/__init__.py +0 -0
  15. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest/fixture_context.py +0 -0
  16. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest/models/__init__.py +0 -0
  17. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest/models/executable_test.py +0 -0
  18. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest/utils.py +0 -0
  19. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest.egg-info/dependency_links.txt +0 -0
  20. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest.egg-info/entry_points.txt +0 -0
  21. {testit_adapter_pytest-3.3.2 → testit_adapter_pytest-3.4.1}/src/testit_adapter_pytest.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: testit-adapter-pytest
3
- Version: 3.3.2
3
+ Version: 3.4.1
4
4
  Summary: Pytest adapter for Test IT
5
5
  Home-page: https://github.com/testit-tms/adapters-python/
6
6
  Author: Integration team
@@ -16,7 +16,16 @@ Description-Content-Type: text/markdown
16
16
  Requires-Dist: pytest
17
17
  Requires-Dist: pytest-xdist
18
18
  Requires-Dist: attrs
19
- Requires-Dist: testit-python-commons==3.3.2
19
+ Requires-Dist: testit-python-commons==3.4.1
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: license
27
+ Dynamic: requires-dist
28
+ Dynamic: summary
20
29
 
21
30
  # Test IT TMS adapter for Pytest
22
31
 
@@ -51,6 +60,7 @@ pip install testit-adapter-pytest
51
60
  | It enables/disables certificate validation (**It's optional**). Default value - true | certValidation | TMS_CERT_VALIDATION | tmsCertValidation |
52
61
  | Mode of automatic creation test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will create a test case linked to the created autotest (not to the updated autotest)<br/>false - in this mode, the adapter will not create a test case | automaticCreationTestCases | TMS_AUTOMATIC_CREATION_TEST_CASES | tmsAutomaticCreationTestCases |
53
62
  | Mode of automatic updation links to test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will update links to test cases<br/>false - in this mode, the adapter will not update link to test cases | automaticUpdationLinksToTestCases | TMS_AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES | tmsAutomaticUpdationLinksToTestCases |
63
+ | Mode of import type selection when launching autotests (**It's optional**). Default value - true. The adapter supports following modes:<br/>true - in this mode, the adapter will create/update each autotest in real time<br/>false - in this mode, the adapter will create/update multiple autotests | importRealtime | TMS_IMPORT_REALTIME | tmsImportRealtime |
54
64
  | Url of proxy server (**It's optional**) | tmsProxy | TMS_PROXY | tmsProxy |
55
65
  | Name of the configuration file If it is not provided, it is used default file name (**It's optional**) | - | TMS_CONFIG_FILE | tmsConfigFile |
56
66
 
@@ -69,6 +79,7 @@ adapterMode = ADAPTER_MODE
69
79
  certValidation = CERT_VALIDATION
70
80
  automaticCreationTestCases = AUTOMATIC_CREATION_TEST_CASES
71
81
  automaticUpdationLinksToTestCases = AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
82
+ importRealtime = IMPORT_REALTIME
72
83
 
73
84
  # This section are optional. It enables debug mode.
74
85
  [debug]
@@ -86,7 +97,7 @@ $ pytest --testit
86
97
  Launch with command-line parameters:
87
98
 
88
99
  ```
89
- $ pytest --testit --tmsUrl=URL --tmsPrivateToken=USER_PRIVATE_TOKEN --tmsProjectId=PROJECT_ID --tmsConfigurationId=CONFIGURATION_ID --tmsTestRunId=TEST_RUN_ID --tmsTestRunName=TEST_RUN_NAME --tmsAdapterMode=ADAPTER_MODE --tmsProxy='{"http":"http://localhost:8888","https":"http://localhost:8888"}' --tmsCertValidation=CERT_VALIDATION --tmsAutomaticCreationTestCases=AUTOMATIC_CREATION_TEST_CASES --tmsAutomaticUpdationLinksToTestCases=AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
100
+ $ pytest --testit --tmsUrl=URL --tmsPrivateToken=USER_PRIVATE_TOKEN --tmsProjectId=PROJECT_ID --tmsConfigurationId=CONFIGURATION_ID --tmsTestRunId=TEST_RUN_ID --tmsTestRunName=TEST_RUN_NAME --tmsAdapterMode=ADAPTER_MODE --tmsProxy='{"http":"http://localhost:8888","https":"http://localhost:8888"}' --tmsCertValidation=CERT_VALIDATION --tmsAutomaticCreationTestCases=AUTOMATIC_CREATION_TEST_CASES --tmsAutomaticUpdationLinksToTestCases=AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES --tmsImportRealtime=IMPORT_REALTIME
90
101
  ```
91
102
 
92
103
  If you want to enable debug mode then
@@ -31,6 +31,7 @@ pip install testit-adapter-pytest
31
31
  | It enables/disables certificate validation (**It's optional**). Default value - true | certValidation | TMS_CERT_VALIDATION | tmsCertValidation |
32
32
  | Mode of automatic creation test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will create a test case linked to the created autotest (not to the updated autotest)<br/>false - in this mode, the adapter will not create a test case | automaticCreationTestCases | TMS_AUTOMATIC_CREATION_TEST_CASES | tmsAutomaticCreationTestCases |
33
33
  | Mode of automatic updation links to test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will update links to test cases<br/>false - in this mode, the adapter will not update link to test cases | automaticUpdationLinksToTestCases | TMS_AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES | tmsAutomaticUpdationLinksToTestCases |
34
+ | Mode of import type selection when launching autotests (**It's optional**). Default value - true. The adapter supports following modes:<br/>true - in this mode, the adapter will create/update each autotest in real time<br/>false - in this mode, the adapter will create/update multiple autotests | importRealtime | TMS_IMPORT_REALTIME | tmsImportRealtime |
34
35
  | Url of proxy server (**It's optional**) | tmsProxy | TMS_PROXY | tmsProxy |
35
36
  | Name of the configuration file If it is not provided, it is used default file name (**It's optional**) | - | TMS_CONFIG_FILE | tmsConfigFile |
36
37
 
@@ -49,6 +50,7 @@ adapterMode = ADAPTER_MODE
49
50
  certValidation = CERT_VALIDATION
50
51
  automaticCreationTestCases = AUTOMATIC_CREATION_TEST_CASES
51
52
  automaticUpdationLinksToTestCases = AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
53
+ importRealtime = IMPORT_REALTIME
52
54
 
53
55
  # This section are optional. It enables debug mode.
54
56
  [debug]
@@ -66,7 +68,7 @@ $ pytest --testit
66
68
  Launch with command-line parameters:
67
69
 
68
70
  ```
69
- $ pytest --testit --tmsUrl=URL --tmsPrivateToken=USER_PRIVATE_TOKEN --tmsProjectId=PROJECT_ID --tmsConfigurationId=CONFIGURATION_ID --tmsTestRunId=TEST_RUN_ID --tmsTestRunName=TEST_RUN_NAME --tmsAdapterMode=ADAPTER_MODE --tmsProxy='{"http":"http://localhost:8888","https":"http://localhost:8888"}' --tmsCertValidation=CERT_VALIDATION --tmsAutomaticCreationTestCases=AUTOMATIC_CREATION_TEST_CASES --tmsAutomaticUpdationLinksToTestCases=AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
71
+ $ pytest --testit --tmsUrl=URL --tmsPrivateToken=USER_PRIVATE_TOKEN --tmsProjectId=PROJECT_ID --tmsConfigurationId=CONFIGURATION_ID --tmsTestRunId=TEST_RUN_ID --tmsTestRunName=TEST_RUN_NAME --tmsAdapterMode=ADAPTER_MODE --tmsProxy='{"http":"http://localhost:8888","https":"http://localhost:8888"}' --tmsCertValidation=CERT_VALIDATION --tmsAutomaticCreationTestCases=AUTOMATIC_CREATION_TEST_CASES --tmsAutomaticUpdationLinksToTestCases=AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES --tmsImportRealtime=IMPORT_REALTIME
70
72
  ```
71
73
 
72
74
  If you want to enable debug mode then
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
4
  name='testit-adapter-pytest',
5
- version='3.3.2',
5
+ version='3.4.1',
6
6
  description='Pytest adapter for Test IT',
7
7
  long_description=open('README.md', "r").read(),
8
8
  long_description_content_type="text/markdown",
@@ -21,6 +21,6 @@ setup(
21
21
  py_modules=['testit_adapter_pytest'],
22
22
  packages=find_packages(where='src'),
23
23
  package_dir={'': 'src'},
24
- install_requires=['pytest', 'pytest-xdist', 'attrs', 'testit-python-commons==3.3.2'],
24
+ install_requires=['pytest', 'pytest-xdist', 'attrs', 'testit-python-commons==3.4.1'],
25
25
  entry_points={'pytest11': ['testit_adapter_pytest = testit_adapter_pytest.plugin']}
26
26
  )
@@ -8,14 +8,12 @@ import pytest
8
8
 
9
9
  import testit_python_commons.services as adapter
10
10
  from testit_python_commons.models.outcome_type import OutcomeType
11
- from testit_python_commons.services import AdapterManager
12
- from testit_python_commons.services import StepManager
11
+ from testit_python_commons.models.fixture import FixtureResult, FixturesContainer
12
+ from testit_python_commons.services import AdapterManager, StepManager, FixtureManager
13
13
  from testit_python_commons.services.logger import adapter_logger
14
14
 
15
15
  import testit_adapter_pytest.utils as utils
16
16
  from testit_adapter_pytest.fixture_context import FixtureContext
17
- from testit_adapter_pytest.fixture_manager import FixtureManager
18
- from testit_adapter_pytest.models.fixture import FixtureResult, FixturesContainer
19
17
 
20
18
  STATUS = {
21
19
  'passed': OutcomeType.PASSED,
@@ -66,12 +64,11 @@ class TmsListener(object):
66
64
  __pytest_check_info = None
67
65
  __failures = None
68
66
 
69
- def __init__(self, adapter_manager: AdapterManager, step_manager: StepManager):
67
+ def __init__(self, adapter_manager: AdapterManager, step_manager: StepManager, fixture_manager: FixtureManager):
70
68
  self.__adapter_manager = adapter_manager
71
69
  self.__step_manager = step_manager
72
- self.fixture_manager = FixtureManager()
70
+ self.__fixture_manager = fixture_manager
73
71
  self._cache = ItemCache()
74
- self.__test_result_ids = {}
75
72
 
76
73
  @pytest.hookimpl
77
74
  def pytest_configure(self, config):
@@ -189,21 +186,21 @@ class TmsListener(object):
189
186
  if not container_uuid:
190
187
  container_uuid = self._cache.push(fixturedef)
191
188
  container = FixturesContainer(uuid=container_uuid)
192
- self.fixture_manager.start_group(container_uuid, container)
189
+ self.__fixture_manager.start_group(container_uuid, container)
193
190
 
194
- self.fixture_manager.update_group(container_uuid)
191
+ self.__fixture_manager.update_group(container_uuid)
195
192
 
196
193
  before_fixture_uuid = uuid4()
197
194
  before_fixture = FixtureResult(title=fixture_name)
198
195
 
199
- self.fixture_manager.start_before_fixture(container_uuid, before_fixture_uuid, before_fixture)
196
+ self.__fixture_manager.start_before_fixture(container_uuid, before_fixture_uuid, before_fixture)
200
197
 
201
198
  outcome = yield
202
199
 
203
200
  results_steps_data = self.__step_manager.get_steps_tree()
204
201
 
205
- self.fixture_manager.stop_before_fixture(before_fixture_uuid,
206
- outcome=utils.get_outcome_status(outcome), steps=results_steps_data)
202
+ self.__fixture_manager.stop_before_fixture(before_fixture_uuid,
203
+ outcome=utils.get_outcome_status(outcome), steps=results_steps_data)
207
204
 
208
205
  finalizers = getattr(fixturedef, '_finalizers', [])
209
206
  for index, finalizer in enumerate(finalizers):
@@ -230,7 +227,7 @@ class TmsListener(object):
230
227
 
231
228
  if hasattr(fixturedef, 'cached_result') and self._cache.get(fixturedef):
232
229
  group_uuid = self._cache.pop(fixturedef)
233
- self.fixture_manager.stop_group(group_uuid)
230
+ self.__fixture_manager.stop_group(group_uuid)
234
231
 
235
232
  @pytest.hookimpl
236
233
  def pytest_runtest_logreport(self, report):
@@ -257,19 +254,12 @@ class TmsListener(object):
257
254
  if not self.__executable_test:
258
255
  return
259
256
 
260
- self.__test_result_ids[self.__executable_test.node_id] = self.__adapter_manager.write_test(
257
+ self.__adapter_manager.write_test(
261
258
  utils.convert_executable_test_to_test_result_model(self.__executable_test))
262
259
 
263
260
  @pytest.hookimpl
264
261
  def pytest_sessionfinish(self, session):
265
- if not self.__test_result_ids:
266
- return
267
-
268
- self.__adapter_manager.load_setup_and_teardown_step_results(
269
- utils.fixtures_containers_to_test_results_with_all_fixture_step_results(
270
- self.fixture_manager.get_all_items(),
271
- self.__test_result_ids
272
- ))
262
+ self.__adapter_manager.write_tests()
273
263
 
274
264
  @adapter.hookimpl
275
265
  def add_link(self, link):
@@ -294,29 +284,29 @@ class TmsListener(object):
294
284
  @adapter.hookimpl
295
285
  def start_fixture(self, parent_uuid, uuid, title):
296
286
  after_fixture = FixtureResult(title=title)
297
- self.fixture_manager.start_after_fixture(parent_uuid, uuid, after_fixture)
287
+ self.__fixture_manager.start_after_fixture(parent_uuid, uuid, after_fixture)
298
288
 
299
289
  @adapter.hookimpl
300
290
  def stop_fixture(self, uuid, exc_type, exc_val, exc_tb):
301
291
  results_steps_data = self.__step_manager.get_steps_tree()
302
292
 
303
- self.fixture_manager.stop_after_fixture(uuid,
304
- outcome=utils.get_status(exc_val),
305
- steps=results_steps_data,
306
- message=utils.get_message(exc_type, exc_val),
307
- stacktrace=utils.get_traceback(exc_tb))
293
+ self.__fixture_manager.stop_after_fixture(uuid,
294
+ outcome=utils.get_status(exc_val),
295
+ steps=results_steps_data,
296
+ message=utils.get_message(exc_type, exc_val),
297
+ stacktrace=utils.get_traceback(exc_tb))
308
298
 
309
299
  def _update_fixtures_external_ids(self, item):
310
300
  for fixturedef in self._test_fixtures(item):
311
301
  group_uuid = self._cache.get(fixturedef)
312
302
  if group_uuid:
313
- group = self.fixture_manager.get_item(group_uuid)
303
+ group = self.__fixture_manager.get_item(group_uuid)
314
304
  else:
315
305
  group_uuid = self._cache.push(fixturedef)
316
306
  group = FixturesContainer(uuid=group_uuid)
317
- self.fixture_manager.start_group(group_uuid, group)
318
- if item.nodeid not in group.node_ids:
319
- self.fixture_manager.update_group(group_uuid, node_ids=item.nodeid)
307
+ self.__fixture_manager.start_group(group_uuid, group)
308
+ if self.__executable_test.external_id not in group.external_ids:
309
+ self.__fixture_manager.update_group(group_uuid, external_ids=self.__executable_test.external_id)
320
310
 
321
311
  def _test_fixtures(self, item):
322
312
  fixturemanager = item.session._fixturemanager
@@ -109,6 +109,17 @@ def pytest_addoption(parser):
109
109
  false - not update links to test cases (Default)
110
110
  """
111
111
  )
112
+ parser.getgroup('testit').addoption(
113
+ '--tmsImportRealtime',
114
+ action="store",
115
+ dest="set_import_realtime",
116
+ metavar="false",
117
+ help="""
118
+ Set mode of import type selection when launching autotests (optional):
119
+ true - the adapter will create/update each autotest in real time (Default)
120
+ false - the adapter will create/update multiple autotests
121
+ """
122
+ )
112
123
 
113
124
 
114
125
  @pytest.mark.tryfirst
@@ -116,7 +127,8 @@ def pytest_cmdline_main(config):
116
127
  if config.option.tms_report:
117
128
  listener = TmsListener(
118
129
  TmsPluginManager.get_adapter_manager(config.option),
119
- TmsPluginManager.get_step_manager())
130
+ TmsPluginManager.get_step_manager(),
131
+ TmsPluginManager.get_fixture_manager())
120
132
 
121
133
  config.pluginmanager.register(listener)
122
134
  TmsPluginManager.get_plugin_manager().register(listener)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: testit-adapter-pytest
3
- Version: 3.3.2
3
+ Version: 3.4.1
4
4
  Summary: Pytest adapter for Test IT
5
5
  Home-page: https://github.com/testit-tms/adapters-python/
6
6
  Author: Integration team
@@ -16,7 +16,16 @@ Description-Content-Type: text/markdown
16
16
  Requires-Dist: pytest
17
17
  Requires-Dist: pytest-xdist
18
18
  Requires-Dist: attrs
19
- Requires-Dist: testit-python-commons==3.3.2
19
+ Requires-Dist: testit-python-commons==3.4.1
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: license
27
+ Dynamic: requires-dist
28
+ Dynamic: summary
20
29
 
21
30
  # Test IT TMS adapter for Pytest
22
31
 
@@ -51,6 +60,7 @@ pip install testit-adapter-pytest
51
60
  | It enables/disables certificate validation (**It's optional**). Default value - true | certValidation | TMS_CERT_VALIDATION | tmsCertValidation |
52
61
  | Mode of automatic creation test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will create a test case linked to the created autotest (not to the updated autotest)<br/>false - in this mode, the adapter will not create a test case | automaticCreationTestCases | TMS_AUTOMATIC_CREATION_TEST_CASES | tmsAutomaticCreationTestCases |
53
62
  | Mode of automatic updation links to test cases (**It's optional**). Default value - false. The adapter supports following modes:<br/>true - in this mode, the adapter will update links to test cases<br/>false - in this mode, the adapter will not update link to test cases | automaticUpdationLinksToTestCases | TMS_AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES | tmsAutomaticUpdationLinksToTestCases |
63
+ | Mode of import type selection when launching autotests (**It's optional**). Default value - true. The adapter supports following modes:<br/>true - in this mode, the adapter will create/update each autotest in real time<br/>false - in this mode, the adapter will create/update multiple autotests | importRealtime | TMS_IMPORT_REALTIME | tmsImportRealtime |
54
64
  | Url of proxy server (**It's optional**) | tmsProxy | TMS_PROXY | tmsProxy |
55
65
  | Name of the configuration file If it is not provided, it is used default file name (**It's optional**) | - | TMS_CONFIG_FILE | tmsConfigFile |
56
66
 
@@ -69,6 +79,7 @@ adapterMode = ADAPTER_MODE
69
79
  certValidation = CERT_VALIDATION
70
80
  automaticCreationTestCases = AUTOMATIC_CREATION_TEST_CASES
71
81
  automaticUpdationLinksToTestCases = AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
82
+ importRealtime = IMPORT_REALTIME
72
83
 
73
84
  # This section are optional. It enables debug mode.
74
85
  [debug]
@@ -86,7 +97,7 @@ $ pytest --testit
86
97
  Launch with command-line parameters:
87
98
 
88
99
  ```
89
- $ pytest --testit --tmsUrl=URL --tmsPrivateToken=USER_PRIVATE_TOKEN --tmsProjectId=PROJECT_ID --tmsConfigurationId=CONFIGURATION_ID --tmsTestRunId=TEST_RUN_ID --tmsTestRunName=TEST_RUN_NAME --tmsAdapterMode=ADAPTER_MODE --tmsProxy='{"http":"http://localhost:8888","https":"http://localhost:8888"}' --tmsCertValidation=CERT_VALIDATION --tmsAutomaticCreationTestCases=AUTOMATIC_CREATION_TEST_CASES --tmsAutomaticUpdationLinksToTestCases=AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES
100
+ $ pytest --testit --tmsUrl=URL --tmsPrivateToken=USER_PRIVATE_TOKEN --tmsProjectId=PROJECT_ID --tmsConfigurationId=CONFIGURATION_ID --tmsTestRunId=TEST_RUN_ID --tmsTestRunName=TEST_RUN_NAME --tmsAdapterMode=ADAPTER_MODE --tmsProxy='{"http":"http://localhost:8888","https":"http://localhost:8888"}' --tmsCertValidation=CERT_VALIDATION --tmsAutomaticCreationTestCases=AUTOMATIC_CREATION_TEST_CASES --tmsAutomaticUpdationLinksToTestCases=AUTOMATIC_UPDATION_LINKS_TO_TEST_CASES --tmsImportRealtime=IMPORT_REALTIME
90
101
  ```
91
102
 
92
103
  If you want to enable debug mode then
@@ -2,8 +2,6 @@ README.md
2
2
  setup.py
3
3
  src/testit_adapter_pytest/__init__.py
4
4
  src/testit_adapter_pytest/fixture_context.py
5
- src/testit_adapter_pytest/fixture_manager.py
6
- src/testit_adapter_pytest/fixture_storage.py
7
5
  src/testit_adapter_pytest/listener.py
8
6
  src/testit_adapter_pytest/plugin.py
9
7
  src/testit_adapter_pytest/utils.py
@@ -14,5 +12,4 @@ src/testit_adapter_pytest.egg-info/entry_points.txt
14
12
  src/testit_adapter_pytest.egg-info/requires.txt
15
13
  src/testit_adapter_pytest.egg-info/top_level.txt
16
14
  src/testit_adapter_pytest/models/__init__.py
17
- src/testit_adapter_pytest/models/executable_test.py
18
- src/testit_adapter_pytest/models/fixture.py
15
+ src/testit_adapter_pytest/models/executable_test.py
@@ -0,0 +1,4 @@
1
+ pytest
2
+ pytest-xdist
3
+ attrs
4
+ testit-python-commons==3.4.1
@@ -1,60 +0,0 @@
1
- from testit_adapter_pytest.fixture_storage import ThreadContextFixtures
2
- from testit_adapter_pytest.models.fixture import FixtureResult
3
-
4
-
5
- class FixtureManager:
6
- def __init__(self):
7
- self._items = ThreadContextFixtures()
8
- self._orphan_items = []
9
-
10
- def _update_item(self, uuid, **kwargs):
11
- item = self._items[uuid] if uuid else self._items[next(reversed(self._items))]
12
- for name, value in kwargs.items():
13
- attr = getattr(item, name)
14
- if isinstance(attr, list):
15
- attr.append(value)
16
- else:
17
- setattr(item, name, value)
18
-
19
- def _last_executable(self):
20
- for _uuid in reversed(self._items):
21
- if isinstance(self._items[_uuid], FixtureResult):
22
- return _uuid
23
-
24
- def get_item(self, uuid):
25
- return self._items.get(uuid)
26
-
27
- def get_last_item(self, item_type=None):
28
- for _uuid in reversed(self._items):
29
- if item_type is None:
30
- return self._items.get(_uuid)
31
- if type(self._items[_uuid]) == item_type:
32
- return self._items.get(_uuid)
33
-
34
- def start_group(self, uuid, group):
35
- self._items[uuid] = group
36
-
37
- def stop_group(self, uuid, **kwargs):
38
- self._update_item(uuid, **kwargs)
39
-
40
- def update_group(self, uuid, **kwargs):
41
- self._update_item(uuid, **kwargs)
42
-
43
- def start_before_fixture(self, parent_uuid, uuid, fixture):
44
- self._items.get(parent_uuid).befores.append(fixture)
45
- self._items[uuid] = fixture
46
-
47
- def stop_before_fixture(self, uuid, **kwargs):
48
- self._update_item(uuid, **kwargs)
49
- self._items.pop(uuid)
50
-
51
- def start_after_fixture(self, parent_uuid, uuid, fixture):
52
- self._items.get(parent_uuid).afters.append(fixture)
53
- self._items[uuid] = fixture
54
-
55
- def stop_after_fixture(self, uuid, **kwargs):
56
- self._update_item(uuid, **kwargs)
57
- self._items.pop(uuid)
58
-
59
- def get_all_items(self):
60
- return self._items.get_all()
@@ -1,40 +0,0 @@
1
- import threading
2
- from collections import OrderedDict, defaultdict
3
-
4
-
5
- class ThreadContextFixtures:
6
- _thread_context = defaultdict(OrderedDict)
7
- _init_thread: threading.Thread
8
-
9
- @property
10
- def thread_context(self):
11
- context = self._thread_context[threading.current_thread()]
12
- if not context and threading.current_thread() is not self._init_thread:
13
- uuid, last_item = next(reversed(self._thread_context[self._init_thread].items()))
14
- context[uuid] = last_item
15
- return context
16
-
17
- def __init__(self, *args, **kwargs):
18
- self._init_thread = threading.current_thread()
19
- super().__init__(*args, **kwargs)
20
-
21
- def __setitem__(self, key, value):
22
- self.thread_context.__setitem__(key, value)
23
-
24
- def __getitem__(self, item):
25
- return self.thread_context.__getitem__(item)
26
-
27
- def __iter__(self):
28
- return self.thread_context.__iter__()
29
-
30
- def __reversed__(self):
31
- return self.thread_context.__reversed__()
32
-
33
- def get(self, key):
34
- return self.thread_context.get(key)
35
-
36
- def pop(self, key):
37
- return self.thread_context.pop(key)
38
-
39
- def get_all(self):
40
- return dict(self.thread_context.items())
@@ -1,24 +0,0 @@
1
- from attr import attrs, attrib
2
- from attr import Factory
3
-
4
-
5
- @attrs
6
- class FixtureResult:
7
- title = attrib(default=None)
8
- outcome = attrib(default=None)
9
- description = attrib(default=None)
10
- message = attrib(default=None)
11
- stacktrace = attrib(default=None)
12
- steps = attrib(default=None)
13
- attachments = attrib(default=Factory(list))
14
- parameters = attrib(default=Factory(list))
15
- start = attrib(default=None)
16
- stop = attrib(default=None)
17
-
18
-
19
- @attrs
20
- class FixturesContainer:
21
- uuid = attrib(default=None)
22
- node_ids = attrib(default=Factory(list))
23
- befores = attrib(default=Factory(list))
24
- afters = attrib(default=Factory(list))
@@ -1,4 +0,0 @@
1
- pytest
2
- pytest-xdist
3
- attrs
4
- testit-python-commons==3.3.2