testit-adapter-pytest 3.0.2__tar.gz → 3.1.0__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.0.2 → testit_adapter_pytest-3.1.0}/PKG-INFO +2 -4
  2. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/setup.py +2 -4
  3. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/listener.py +17 -10
  4. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest.egg-info/PKG-INFO +2 -4
  5. testit_adapter_pytest-3.1.0/src/testit_adapter_pytest.egg-info/requires.txt +4 -0
  6. testit_adapter_pytest-3.0.2/src/testit_adapter_pytest.egg-info/requires.txt +0 -4
  7. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/README.md +0 -0
  8. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/setup.cfg +0 -0
  9. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/__init__.py +0 -0
  10. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/fixture_context.py +0 -0
  11. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/fixture_manager.py +0 -0
  12. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/fixture_storage.py +0 -0
  13. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/models/__init__.py +0 -0
  14. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/models/executable_test.py +0 -0
  15. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/models/fixture.py +0 -0
  16. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/plugin.py +0 -0
  17. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest/utils.py +0 -0
  18. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest.egg-info/SOURCES.txt +0 -0
  19. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest.egg-info/dependency_links.txt +0 -0
  20. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest.egg-info/entry_points.txt +0 -0
  21. {testit_adapter_pytest-3.0.2 → testit_adapter_pytest-3.1.0}/src/testit_adapter_pytest.egg-info/top_level.txt +0 -0
@@ -1,14 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: testit-adapter-pytest
3
- Version: 3.0.2
3
+ Version: 3.1.0
4
4
  Summary: Pytest adapter for Test IT
5
5
  Home-page: https://github.com/testit-tms/adapters-python/
6
6
  Author: Integration team
7
7
  Author-email: integrations@testit.software
8
8
  License: Apache-2.0
9
9
  Classifier: Programming Language :: Python :: 3
10
- Classifier: Programming Language :: Python :: 3.6
11
- Classifier: Programming Language :: Python :: 3.7
12
10
  Classifier: Programming Language :: Python :: 3.8
13
11
  Classifier: Programming Language :: Python :: 3.9
14
12
  Classifier: Programming Language :: Python :: 3.10
@@ -18,7 +16,7 @@ Description-Content-Type: text/markdown
18
16
  Requires-Dist: pytest
19
17
  Requires-Dist: pytest-xdist
20
18
  Requires-Dist: attrs
21
- Requires-Dist: testit-python-commons==3.0.2
19
+ Requires-Dist: testit-python-commons==3.1.0
22
20
 
23
21
  # Test IT TMS adapter for Pytest
24
22
 
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
4
  name='testit-adapter-pytest',
5
- version='3.0.2',
5
+ version='3.1.0',
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",
@@ -12,8 +12,6 @@ setup(
12
12
  license='Apache-2.0',
13
13
  classifiers=[
14
14
  'Programming Language :: Python :: 3',
15
- 'Programming Language :: Python :: 3.6',
16
- 'Programming Language :: Python :: 3.7',
17
15
  'Programming Language :: Python :: 3.8',
18
16
  'Programming Language :: Python :: 3.9',
19
17
  'Programming Language :: Python :: 3.10',
@@ -23,6 +21,6 @@ setup(
23
21
  py_modules=['testit_adapter_pytest'],
24
22
  packages=find_packages(where='src'),
25
23
  package_dir={'': 'src'},
26
- install_requires=['pytest', 'pytest-xdist', 'attrs', 'testit-python-commons==3.0.2'],
24
+ install_requires=['pytest', 'pytest-xdist', 'attrs', 'testit-python-commons==3.1.0'],
27
25
  entry_points={'pytest11': ['testit_adapter_pytest = testit_adapter_pytest.plugin']}
28
26
  )
@@ -1,4 +1,5 @@
1
1
  import pickle
2
+ from importlib.metadata import metadata
2
3
  from uuid import uuid4
3
4
 
4
5
  from packaging import version
@@ -61,6 +62,7 @@ class SeparationOfTests:
61
62
 
62
63
  class TmsListener(object):
63
64
  __executable_test = None
65
+ __pytest_info = None
64
66
  __pytest_check_info = None
65
67
  __failures = None
66
68
 
@@ -73,6 +75,8 @@ class TmsListener(object):
73
75
 
74
76
  @pytest.hookimpl
75
77
  def pytest_configure(self, config):
78
+ self.__pytest_info = metadata("pytest")
79
+
76
80
  if not hasattr(config, "workerinput") and not hasattr(self, "test_run_id"):
77
81
  config.test_run_id = self.__adapter_manager.get_test_run_id()
78
82
  else:
@@ -303,7 +307,7 @@ class TmsListener(object):
303
307
  stacktrace=utils.get_traceback(exc_tb))
304
308
 
305
309
  def _update_fixtures_external_ids(self, item):
306
- for fixturedef in _test_fixtures(item):
310
+ for fixturedef in self._test_fixtures(item):
307
311
  group_uuid = self._cache.get(fixturedef)
308
312
  if group_uuid:
309
313
  group = self.fixture_manager.get_item(group_uuid)
@@ -314,15 +318,18 @@ class TmsListener(object):
314
318
  if item.nodeid not in group.node_ids:
315
319
  self.fixture_manager.update_group(group_uuid, node_ids=item.nodeid)
316
320
 
321
+ def _test_fixtures(self, item):
322
+ fixturemanager = item.session._fixturemanager
323
+ fixturedefs = []
317
324
 
318
- def _test_fixtures(item):
319
- fixturemanager = item.session._fixturemanager
320
- fixturedefs = []
325
+ if hasattr(item, "_request") and hasattr(item._request, "fixturenames"):
326
+ for name in item._request.fixturenames:
327
+ if self.__pytest_info and version.parse(self.__pytest_info["version"]) >= version.parse("8.1.0"):
328
+ fixturedefs_pytest = fixturemanager.getfixturedefs(name, item)
329
+ else:
330
+ fixturedefs_pytest = fixturemanager.getfixturedefs(name, item.nodeid)
321
331
 
322
- if hasattr(item, "_request") and hasattr(item._request, "fixturenames"):
323
- for name in item._request.fixturenames:
324
- fixturedefs_pytest = fixturemanager.getfixturedefs(name, item.nodeid)
325
- if fixturedefs_pytest:
326
- fixturedefs.extend(fixturedefs_pytest)
332
+ if fixturedefs_pytest:
333
+ fixturedefs.extend(fixturedefs_pytest)
327
334
 
328
- return fixturedefs
335
+ return fixturedefs
@@ -1,14 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: testit-adapter-pytest
3
- Version: 3.0.2
3
+ Version: 3.1.0
4
4
  Summary: Pytest adapter for Test IT
5
5
  Home-page: https://github.com/testit-tms/adapters-python/
6
6
  Author: Integration team
7
7
  Author-email: integrations@testit.software
8
8
  License: Apache-2.0
9
9
  Classifier: Programming Language :: Python :: 3
10
- Classifier: Programming Language :: Python :: 3.6
11
- Classifier: Programming Language :: Python :: 3.7
12
10
  Classifier: Programming Language :: Python :: 3.8
13
11
  Classifier: Programming Language :: Python :: 3.9
14
12
  Classifier: Programming Language :: Python :: 3.10
@@ -18,7 +16,7 @@ Description-Content-Type: text/markdown
18
16
  Requires-Dist: pytest
19
17
  Requires-Dist: pytest-xdist
20
18
  Requires-Dist: attrs
21
- Requires-Dist: testit-python-commons==3.0.2
19
+ Requires-Dist: testit-python-commons==3.1.0
22
20
 
23
21
  # Test IT TMS adapter for Pytest
24
22
 
@@ -0,0 +1,4 @@
1
+ pytest
2
+ pytest-xdist
3
+ attrs
4
+ testit-python-commons==3.1.0
@@ -1,4 +0,0 @@
1
- pytest
2
- pytest-xdist
3
- attrs
4
- testit-python-commons==3.0.2