Repository navigation
Update tcms-api to >=17.3 and support TestCase decorator - #95
Merged
Merged
Conversation
atodorov
marked this pull request as draft
December 3, 2026 15:58
kiwitcms-bot
force-pushed
the
support-testcase-decorator
branch
4 times, most recently
from
December 4, 2026 11:21
41551da to
121c84f
Compare
Pass collected test functions to Backend.test_case_get_or_create() so fields from @testcase are honored. Do not overwrite an explicit TestCase.text supplied by the decorator with the function docstring.
Only fill TestCase.text from the test function docstring when the existing value is empty. This avoids replacing manually written bodies. Fixes #84
kiwitcms-bot
force-pushed
the
support-testcase-decorator
branch
from
December 4, 2026 11:29
121c84f to
a440233
Compare
atodorov
marked this pull request as ready for review
December 4, 2026 11:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tcms-api v17.3 adds a
TestCasedecorator inplugin_helpers.pywhich attaches TestCase model fields to a test function.Backend.test_case_get_or_create()can now accept the decorated callable astest_case_data.This updates the pytest plugin to:
tcms-api>=17.3item.functionduring collection and pass it totest_case_get_or_create()@TestCase(text=...)with the test function docstringExisting summary-only behavior is unchanged when no decorator is used.
Local checks:
pytest -p tcms_pytest_plugin tests/test_docstring_reporting.py(9 passed),black --check,flake8, andpylint.