kiwitcms-pytest-plugin 15.4__tar.gz → 17.3__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 (20) hide show
  1. {kiwitcms_pytest_plugin-15.4/kiwitcms_pytest_plugin.egg-info → kiwitcms_pytest_plugin-17.3}/PKG-INFO +29 -16
  2. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/README.rst +24 -8
  3. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3/kiwitcms_pytest_plugin.egg-info}/PKG-INFO +29 -16
  4. kiwitcms_pytest_plugin-17.3/kiwitcms_pytest_plugin.egg-info/requires.txt +3 -0
  5. kiwitcms_pytest_plugin-17.3/requirements.txt +3 -0
  6. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/setup.cfg +4 -0
  7. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/setup.py +2 -6
  8. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/tcms_pytest_plugin/__init__.py +5 -2
  9. kiwitcms_pytest_plugin-17.3/tcms_pytest_plugin/version.py +1 -0
  10. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/tests/test_docstring_reporting.py +66 -3
  11. kiwitcms_pytest_plugin-15.4/kiwitcms_pytest_plugin.egg-info/requires.txt +0 -3
  12. kiwitcms_pytest_plugin-15.4/requirements.txt +0 -3
  13. kiwitcms_pytest_plugin-15.4/tcms_pytest_plugin/version.py +0 -1
  14. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/LICENSE +0 -0
  15. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/MANIFEST.in +0 -0
  16. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/kiwitcms_pytest_plugin.egg-info/SOURCES.txt +0 -0
  17. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/kiwitcms_pytest_plugin.egg-info/dependency_links.txt +0 -0
  18. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/kiwitcms_pytest_plugin.egg-info/entry_points.txt +0 -0
  19. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/kiwitcms_pytest_plugin.egg-info/top_level.txt +0 -0
  20. {kiwitcms_pytest_plugin-15.4 → kiwitcms_pytest_plugin-17.3}/tests/test_kiwitcms.py +0 -0
@@ -1,23 +1,20 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kiwitcms-pytest-plugin
3
- Version: 15.4
3
+ Version: 17.3
4
4
  Summary: Pytest plugin for Kiwi TCMS test case management system
5
5
  Home-page: https://github.com/kiwitcms/pytest-plugin
6
6
  Maintainer: Kiwi TCMS
7
7
  Maintainer-email: info@kiwitcms.org
8
+ License: GPLv3
8
9
  Classifier: Development Status :: 4 - Beta
9
10
  Classifier: Environment :: Console
10
11
  Classifier: Framework :: Pytest
11
12
  Classifier: Intended Audience :: Developers
12
13
  Classifier: Intended Audience :: System Administrators
13
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
14
14
  Classifier: Operating System :: POSIX
15
15
  Classifier: Programming Language :: Python
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.6
18
- Classifier: Programming Language :: Python :: 3.7
19
- Classifier: Programming Language :: Python :: 3.8
20
- Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.14
21
18
  Classifier: Programming Language :: Python :: Implementation :: CPython
22
19
  Classifier: Topic :: Software Development
23
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
@@ -26,8 +23,8 @@ Classifier: Topic :: Software Development :: Testing
26
23
  Requires-Python: >=3.6
27
24
  License-File: LICENSE
28
25
  Requires-Dist: pytest
29
- Requires-Dist: tcms-api>=15.0
30
- Requires-Dist: requests>=2.32.0
26
+ Requires-Dist: tcms-api>=17.3
27
+ Requires-Dist: requests>=2.34.2
31
28
  Dynamic: classifier
32
29
  Dynamic: description
33
30
  Dynamic: home-page
@@ -50,14 +47,6 @@ kiwitcms-pytest-plugin
50
47
  :target: https://pypi.org/project/kiwitcms-pytest-plugin
51
48
  :alt: Python versions
52
49
 
53
- .. image:: https://tidelift.com/badges/package/pypi/kiwitcms
54
- :target: https://tidelift.com/subscription/pkg/pypi-kiwitcms?utm_source=pypi-kiwitcms&utm_medium=github&utm_campaign=readme
55
- :alt: Tidelift
56
-
57
- .. image:: https://opencollective.com/kiwitcms/tiers/sponsor/badge.svg?label=sponsors&color=brightgreen
58
- :target: https://opencollective.com/kiwitcms#contributors
59
- :alt: Become a sponsor
60
-
61
50
  .. image:: https://img.shields.io/twitter/follow/KiwiTCMS.svg
62
51
  :target: https://twitter.com/KiwiTCMS
63
52
  :alt: Kiwi TCMS on Twitter
@@ -99,9 +88,33 @@ Usage
99
88
  pytest -p tcms_pytest_plugin --kiwitcms
100
89
 
101
90
 
91
+ Stable test case identification
92
+ -------------------------------
93
+
94
+ Test functions can be decorated with ``@TestCase`` from
95
+ ``tcms_api.plugin_helpers`` to reuse an existing TestCase or to specify
96
+ additional TestCase fields::
97
+
98
+ from tcms_api.plugin_helpers import TestCase
99
+
100
+ @TestCase(id=45)
101
+ def test_coupon_guest():
102
+ ...
103
+
104
+
102
105
  Changelog
103
106
  ---------
104
107
 
108
+ v17.3 (04 Dec 2026)
109
+ ~~~~~~~~~~~~~~~~~~~
110
+
111
+ - Update tcms-api from 15.0 to 17.3
112
+ - Support the ``@tcms_api.plugin_helpers.TestCase`` decorator for stable
113
+ test case identification
114
+ - Update TestCase.text from the docstring only when the database value is
115
+ empty
116
+
117
+
105
118
  v15.4 (27 Apr 2026)
106
119
  ~~~~~~~~~~~~~~~~~~~
107
120
 
@@ -10,14 +10,6 @@ kiwitcms-pytest-plugin
10
10
  :target: https://pypi.org/project/kiwitcms-pytest-plugin
11
11
  :alt: Python versions
12
12
 
13
- .. image:: https://tidelift.com/badges/package/pypi/kiwitcms
14
- :target: https://tidelift.com/subscription/pkg/pypi-kiwitcms?utm_source=pypi-kiwitcms&utm_medium=github&utm_campaign=readme
15
- :alt: Tidelift
16
-
17
- .. image:: https://opencollective.com/kiwitcms/tiers/sponsor/badge.svg?label=sponsors&color=brightgreen
18
- :target: https://opencollective.com/kiwitcms#contributors
19
- :alt: Become a sponsor
20
-
21
13
  .. image:: https://img.shields.io/twitter/follow/KiwiTCMS.svg
22
14
  :target: https://twitter.com/KiwiTCMS
23
15
  :alt: Kiwi TCMS on Twitter
@@ -59,9 +51,33 @@ Usage
59
51
  pytest -p tcms_pytest_plugin --kiwitcms
60
52
 
61
53
 
54
+ Stable test case identification
55
+ -------------------------------
56
+
57
+ Test functions can be decorated with ``@TestCase`` from
58
+ ``tcms_api.plugin_helpers`` to reuse an existing TestCase or to specify
59
+ additional TestCase fields::
60
+
61
+ from tcms_api.plugin_helpers import TestCase
62
+
63
+ @TestCase(id=45)
64
+ def test_coupon_guest():
65
+ ...
66
+
67
+
62
68
  Changelog
63
69
  ---------
64
70
 
71
+ v17.3 (04 Dec 2026)
72
+ ~~~~~~~~~~~~~~~~~~~
73
+
74
+ - Update tcms-api from 15.0 to 17.3
75
+ - Support the ``@tcms_api.plugin_helpers.TestCase`` decorator for stable
76
+ test case identification
77
+ - Update TestCase.text from the docstring only when the database value is
78
+ empty
79
+
80
+
65
81
  v15.4 (27 Apr 2026)
66
82
  ~~~~~~~~~~~~~~~~~~~
67
83
 
@@ -1,23 +1,20 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kiwitcms-pytest-plugin
3
- Version: 15.4
3
+ Version: 17.3
4
4
  Summary: Pytest plugin for Kiwi TCMS test case management system
5
5
  Home-page: https://github.com/kiwitcms/pytest-plugin
6
6
  Maintainer: Kiwi TCMS
7
7
  Maintainer-email: info@kiwitcms.org
8
+ License: GPLv3
8
9
  Classifier: Development Status :: 4 - Beta
9
10
  Classifier: Environment :: Console
10
11
  Classifier: Framework :: Pytest
11
12
  Classifier: Intended Audience :: Developers
12
13
  Classifier: Intended Audience :: System Administrators
13
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
14
14
  Classifier: Operating System :: POSIX
15
15
  Classifier: Programming Language :: Python
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.6
18
- Classifier: Programming Language :: Python :: 3.7
19
- Classifier: Programming Language :: Python :: 3.8
20
- Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.14
21
18
  Classifier: Programming Language :: Python :: Implementation :: CPython
22
19
  Classifier: Topic :: Software Development
23
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
@@ -26,8 +23,8 @@ Classifier: Topic :: Software Development :: Testing
26
23
  Requires-Python: >=3.6
27
24
  License-File: LICENSE
28
25
  Requires-Dist: pytest
29
- Requires-Dist: tcms-api>=15.0
30
- Requires-Dist: requests>=2.32.0
26
+ Requires-Dist: tcms-api>=17.3
27
+ Requires-Dist: requests>=2.34.2
31
28
  Dynamic: classifier
32
29
  Dynamic: description
33
30
  Dynamic: home-page
@@ -50,14 +47,6 @@ kiwitcms-pytest-plugin
50
47
  :target: https://pypi.org/project/kiwitcms-pytest-plugin
51
48
  :alt: Python versions
52
49
 
53
- .. image:: https://tidelift.com/badges/package/pypi/kiwitcms
54
- :target: https://tidelift.com/subscription/pkg/pypi-kiwitcms?utm_source=pypi-kiwitcms&utm_medium=github&utm_campaign=readme
55
- :alt: Tidelift
56
-
57
- .. image:: https://opencollective.com/kiwitcms/tiers/sponsor/badge.svg?label=sponsors&color=brightgreen
58
- :target: https://opencollective.com/kiwitcms#contributors
59
- :alt: Become a sponsor
60
-
61
50
  .. image:: https://img.shields.io/twitter/follow/KiwiTCMS.svg
62
51
  :target: https://twitter.com/KiwiTCMS
63
52
  :alt: Kiwi TCMS on Twitter
@@ -99,9 +88,33 @@ Usage
99
88
  pytest -p tcms_pytest_plugin --kiwitcms
100
89
 
101
90
 
91
+ Stable test case identification
92
+ -------------------------------
93
+
94
+ Test functions can be decorated with ``@TestCase`` from
95
+ ``tcms_api.plugin_helpers`` to reuse an existing TestCase or to specify
96
+ additional TestCase fields::
97
+
98
+ from tcms_api.plugin_helpers import TestCase
99
+
100
+ @TestCase(id=45)
101
+ def test_coupon_guest():
102
+ ...
103
+
104
+
102
105
  Changelog
103
106
  ---------
104
107
 
108
+ v17.3 (04 Dec 2026)
109
+ ~~~~~~~~~~~~~~~~~~~
110
+
111
+ - Update tcms-api from 15.0 to 17.3
112
+ - Support the ``@tcms_api.plugin_helpers.TestCase`` decorator for stable
113
+ test case identification
114
+ - Update TestCase.text from the docstring only when the database value is
115
+ empty
116
+
117
+
105
118
  v15.4 (27 Apr 2026)
106
119
  ~~~~~~~~~~~~~~~~~~~
107
120
 
@@ -0,0 +1,3 @@
1
+ pytest
2
+ tcms-api>=17.3
3
+ requests>=2.34.2
@@ -0,0 +1,3 @@
1
+ pytest
2
+ tcms-api>=17.3
3
+ requests>=2.34.2 # not directly required, pinned by Snyk to avoid a vulnerability
@@ -1,3 +1,7 @@
1
+ [metadata]
2
+ license = GPLv3
3
+ license_files = LICENSE
4
+
1
5
  [flake8]
2
6
  max-line-length = 102
3
7
  extend-ignore = E203
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # Copyright (c) 2019 Dmitry Dygalo <dadygalo@gmail.com>
5
5
  # Copyright (c) 2021 Bryan Mutai <mutaiwork@gmail.com>
6
- # Copyright (c) 2021-2022 Alexander Todorov <atodorov@otb.bg>
6
+ # Copyright (c) 2021-2026 Alexander Todorov <atodorov@otb.bg>
7
7
  #
8
8
  # Licensed under the GPLv3: https://www.gnu.org/licenses/gpl.html
9
9
  import os
@@ -46,14 +46,10 @@ setup(
46
46
  "Framework :: Pytest",
47
47
  "Intended Audience :: Developers",
48
48
  "Intended Audience :: System Administrators",
49
- "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
50
49
  "Operating System :: POSIX",
51
50
  "Programming Language :: Python",
52
51
  "Programming Language :: Python :: 3",
53
- "Programming Language :: Python :: 3.6",
54
- "Programming Language :: Python :: 3.7",
55
- "Programming Language :: Python :: 3.8",
56
- "Programming Language :: Python :: 3.11",
52
+ "Programming Language :: Python :: 3.14",
57
53
  "Programming Language :: Python :: Implementation :: CPython",
58
54
  "Topic :: Software Development",
59
55
  "Topic :: Software Development :: Libraries :: Python Modules",
@@ -51,11 +51,13 @@ class KiwiTCMSPlugin:
51
51
  def __init__(self, verbose=False):
52
52
  self.backend = Backend(prefix="[pytest]", verbose=verbose)
53
53
  self._docstrings = {}
54
+ self._test_functions = {}
54
55
 
55
56
  def pytest_collection_finish(self, session):
56
57
  for item in session.items:
57
58
  if not hasattr(item, "function"):
58
59
  continue
60
+ self._test_functions[item.nodeid] = item.function
59
61
  doc = getattr(item.function, "__doc__", None)
60
62
  if doc:
61
63
  self._docstrings[item.nodeid] = inspect.cleandoc(doc)
@@ -67,9 +69,10 @@ class KiwiTCMSPlugin:
67
69
  self.status_weight = 0
68
70
  self.comment = ""
69
71
 
70
- test_case, _ = self.backend.test_case_get_or_create(nodeid)
72
+ test_func = self._test_functions.get(nodeid)
73
+ test_case, _ = self.backend.test_case_get_or_create(nodeid, test_func)
71
74
  docstring = self._docstrings.get(nodeid)
72
- if docstring != test_case["text"]:
75
+ if docstring and not test_case["text"]:
73
76
  self.backend.update_test_case_text(test_case["id"], docstring)
74
77
  self.backend.add_test_case_to_plan(test_case["id"], self.backend.plan_id)
75
78
  self.executions = self.backend.add_test_case_to_run(
@@ -0,0 +1 @@
1
+ __version__ = "17.3"
@@ -8,6 +8,7 @@ from unittest.mock import MagicMock, patch
8
8
 
9
9
  import pytest
10
10
 
11
+ from tcms_api import plugin_helpers
11
12
  from tcms_pytest_plugin import Backend, KiwiTCMSPlugin
12
13
 
13
14
 
@@ -26,11 +27,13 @@ def plugin():
26
27
  yield p
27
28
 
28
29
 
29
- def _make_item(nodeid, docstring):
30
+ def _make_item(nodeid, docstring, decorator_fields=None):
30
31
  """Create a minimal mock pytest item with a function docstring."""
31
32
  item = MagicMock()
32
33
  item.nodeid = nodeid
33
34
  item.function.__doc__ = docstring
35
+ if decorator_fields:
36
+ plugin_helpers.TestCase(**decorator_fields)(item.function)
34
37
  return item
35
38
 
36
39
 
@@ -59,6 +62,66 @@ def test_docstring_is_sent_as_test_case_text(plugin):
59
62
  )
60
63
 
61
64
 
65
+ def test_decorated_function_is_passed_to_backend(plugin):
66
+ """The function object must be passed so @TestCase fields are used."""
67
+ item = _make_item("tests/test_foo.py::test_decorated", "Intent")
68
+ _simulate_collection(plugin, [item])
69
+ _simulate_logstart(plugin, "tests/test_foo.py::test_decorated")
70
+
71
+ plugin.backend.test_case_get_or_create.assert_called_once_with(
72
+ "tests/test_foo.py::test_decorated", item.function
73
+ )
74
+
75
+
76
+ def test_decorator_text_is_not_overwritten_by_docstring(plugin):
77
+ """An explicit @TestCase(text=...) must win over the docstring."""
78
+ plugin.backend.test_case_get_or_create.return_value = (
79
+ {"id": 99, "text": "Explicit text"},
80
+ True,
81
+ )
82
+ item = _make_item(
83
+ "tests/test_foo.py::test_decorated_text",
84
+ "Docstring",
85
+ {"text": "Explicit text"},
86
+ )
87
+ _simulate_collection(plugin, [item])
88
+ _simulate_logstart(plugin, "tests/test_foo.py::test_decorated_text")
89
+
90
+ plugin.backend.update_test_case_text.assert_not_called()
91
+
92
+
93
+ def test_decorator_fields_do_not_prevent_filling_empty_text(plugin):
94
+ """Decorator fields other than text do not block the docstring."""
95
+ item = _make_item("tests/test_foo.py::test_decorated_id", "Docstring", {"id": 45})
96
+ _simulate_collection(plugin, [item])
97
+ _simulate_logstart(plugin, "tests/test_foo.py::test_decorated_id")
98
+
99
+ plugin.backend.update_test_case_text.assert_called_once_with(99, "Docstring")
100
+
101
+
102
+ def test_existing_text_is_not_overwritten_by_docstring(plugin):
103
+ """Existing TestCase.text must be preserved. Fixes #84."""
104
+ plugin.backend.test_case_get_or_create.return_value = (
105
+ {"id": 99, "text": "Manually written body"},
106
+ True,
107
+ )
108
+ item = _make_item("tests/test_foo.py::test_existing_text", "Docstring")
109
+ _simulate_collection(plugin, [item])
110
+ _simulate_logstart(plugin, "tests/test_foo.py::test_existing_text")
111
+
112
+ plugin.backend.update_test_case_text.assert_not_called()
113
+
114
+
115
+ def test_empty_text_is_filled_from_docstring(plugin):
116
+ """An empty TestCase.text must be filled from the docstring."""
117
+ plugin.backend.test_case_get_or_create.return_value = ({"id": 99, "text": ""}, True)
118
+ item = _make_item("tests/test_foo.py::test_empty_text", "Docstring")
119
+ _simulate_collection(plugin, [item])
120
+ _simulate_logstart(plugin, "tests/test_foo.py::test_empty_text")
121
+
122
+ plugin.backend.update_test_case_text.assert_called_once_with(99, "Docstring")
123
+
124
+
62
125
  def test_no_update_when_docstring_is_absent(plugin):
63
126
  """update_test_case_text must not be called when the test has no docstring."""
64
127
  item = MagicMock()
@@ -115,7 +178,7 @@ def test_docstring_not_sent_for_different_nodeid(plugin):
115
178
 
116
179
  _simulate_logstart(plugin, "tests/test_foo.py::test_a")
117
180
  plugin.backend.test_case_get_or_create.assert_called_once_with(
118
- "tests/test_foo.py::test_a"
181
+ "tests/test_foo.py::test_a", item_a.function
119
182
  )
120
183
  plugin.backend.update_test_case_text.assert_called_once_with(99, "Intention A")
121
184
 
@@ -124,7 +187,7 @@ def test_docstring_not_sent_for_different_nodeid(plugin):
124
187
 
125
188
  _simulate_logstart(plugin, "tests/test_foo.py::test_b")
126
189
  plugin.backend.test_case_get_or_create.assert_called_once_with(
127
- "tests/test_foo.py::test_b"
190
+ "tests/test_foo.py::test_b", item_b.function
128
191
  )
129
192
  plugin.backend.update_test_case_text.assert_not_called()
130
193
 
@@ -1,3 +0,0 @@
1
- pytest
2
- tcms-api>=15.0
3
- requests>=2.32.0
@@ -1,3 +0,0 @@
1
- pytest
2
- tcms-api>=15.0
3
- requests>=2.32.0 # not directly required, pinned by Snyk to avoid a vulnerability
@@ -1 +0,0 @@
1
- __version__ = "15.4"