testit-adapter-pytest 3.10.7.post550__tar.gz → 3.10.8__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 (19) hide show
  1. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/PKG-INFO +2 -2
  2. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/setup.py +1 -1
  3. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest/utils.py +19 -12
  4. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest.egg-info/PKG-INFO +2 -2
  5. testit_adapter_pytest-3.10.8/src/testit_adapter_pytest.egg-info/requires.txt +4 -0
  6. testit_adapter_pytest-3.10.7.post550/src/testit_adapter_pytest.egg-info/requires.txt +0 -4
  7. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/README.md +0 -0
  8. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/setup.cfg +0 -0
  9. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest/__init__.py +0 -0
  10. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest/fixture_context.py +0 -0
  11. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest/listener.py +0 -0
  12. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest/models/__init__.py +0 -0
  13. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest/models/executable_test.py +0 -0
  14. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest/plugin.py +0 -0
  15. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest.egg-info/SOURCES.txt +0 -0
  16. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest.egg-info/dependency_links.txt +0 -0
  17. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest.egg-info/entry_points.txt +0 -0
  18. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/src/testit_adapter_pytest.egg-info/top_level.txt +0 -0
  19. {testit_adapter_pytest-3.10.7.post550 → testit_adapter_pytest-3.10.8}/tests/test_listener.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testit-adapter-pytest
3
- Version: 3.10.7.post550
3
+ Version: 3.10.8
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,7 @@ 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.10.7.post550
19
+ Requires-Dist: testit-python-commons==3.10.8
20
20
  Dynamic: author
21
21
  Dynamic: author-email
22
22
  Dynamic: classifier
@@ -1,6 +1,6 @@
1
1
  from setuptools import find_packages, setup
2
2
 
3
- VERSION = "3.10.7.post550"
3
+ VERSION = "3.10.8"
4
4
 
5
5
  setup(
6
6
  name='testit-adapter-pytest',
@@ -8,6 +8,7 @@ import pytest
8
8
 
9
9
  from traceback import format_exception_only
10
10
 
11
+ from _pytest.mark import Mark
11
12
  from testit_python_commons.models.link import Link
12
13
  from testit_python_commons.models.test_result import TestResult
13
14
  from testit_python_commons.models.test_result_with_all_fixture_step_results_model import TestResultWithAllFixtureStepResults
@@ -36,18 +37,24 @@ def form_test(item) -> ExecutableTest:
36
37
  )
37
38
 
38
39
  if item.own_markers:
39
- for mark in item.own_markers:
40
- if mark.name == 'skip' or mark.name == 'skipif':
41
- executable_test.outcome = 'Skipped'
42
- if mark.args:
43
- executable_test.message = mark.args[0]
44
- if mark.kwargs and 'reason' in mark.kwargs:
45
- executable_test.message = mark.kwargs['reason']
46
- if mark.name == 'xfail':
47
- if mark.args:
48
- executable_test.message = mark.args[0]
49
- if mark.kwargs and 'reason' in mark.kwargs:
50
- executable_test.message = mark.kwargs['reason']
40
+ executable_test = __set_outcome_and_message_from_markers(executable_test, item.own_markers)
41
+
42
+ return executable_test
43
+
44
+
45
+ def __set_outcome_and_message_from_markers(executable_test: ExecutableTest, markers: List[Mark]) -> ExecutableTest:
46
+ for marker in markers:
47
+ if marker.name in ('skip', 'skipif'):
48
+ executable_test.outcome = 'Skipped'
49
+ if marker.name in ('skip', 'skipif', 'xfail'):
50
+ if len(marker.args) == 1 and isinstance(marker.args, str):
51
+ executable_test.message = marker.args[0]
52
+
53
+ condition_in_args = marker.args and marker.args[0]
54
+ condition_in_kwargs = marker.kwargs and 'condition' in marker.kwargs and marker.kwargs['condition']
55
+
56
+ if (condition_in_kwargs or condition_in_args) and 'reason' in marker.kwargs:
57
+ executable_test.message = marker.kwargs['reason']
51
58
 
52
59
  return executable_test
53
60
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testit-adapter-pytest
3
- Version: 3.10.7.post550
3
+ Version: 3.10.8
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,7 @@ 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.10.7.post550
19
+ Requires-Dist: testit-python-commons==3.10.8
20
20
  Dynamic: author
21
21
  Dynamic: author-email
22
22
  Dynamic: classifier
@@ -0,0 +1,4 @@
1
+ pytest
2
+ pytest-xdist
3
+ attrs
4
+ testit-python-commons==3.10.8
@@ -1,4 +0,0 @@
1
- pytest
2
- pytest-xdist
3
- attrs
4
- testit-python-commons==3.10.7.post550