fix: comprehensive tests and bug fixes for decorators and processor#60
Merged
fix: comprehensive tests and bug fixes for decorators and processor#60
Conversation
- Create missing src/reqstool_python_decorators/decorators/__init__.py
- Fix broken import paths in test resources and README
(src.reqstool_decorators → reqstool_python_decorators)
- Fix state accumulation bug: reset req_svc_results at start of
process_decorated_data() to prevent results doubling on repeated calls
- Fix fragile AST elementKind extraction: replace CPython repr parsing
str(type(node)).split(".")[-1][:-5] with node.__class__.__name__[:-3]
- Add str | os.PathLike to all path/file parameters
- Add test_decorators.py with 7 tests covering Requirements/SVCs decorators
- Expand test_processors.py from 5 to 32 tests covering all previously
untested methods; standardise fixtures on tmp_path
This was referenced Feb 28, 2026
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.
Summary
mainBug fixes
src/reqstool_python_decorators/decorators/__init__.pysrc.reqstool_decorators→reqstool_python_decorators)req_svc_results = []at start ofprocess_decorated_data()— prevented results doubling on repeated callsstr(type(node)).split(".")[-1][:-5].upper()withnode.__class__.__name__[:-3].upper()Tests
tests/unit/reqstool_decorators/test_decorators.py— 7 tests forRequirementsandSVCsdecoratorstest_processors.py— 32 tests covering all previously untested methodstest_get_functions_and_classes_element_kinddirectly targets Fix 4 across all three node typestmp_pathOther
str | os.PathLiketo all path/file parameters