Skip to content

fix: comprehensive tests and bug fixes for decorators and processor#60

Merged
jimisola merged 2 commits intomainfrom
fix/bug-fixes-and-tests
Mar 1, 2026
Merged

fix: comprehensive tests and bug fixes for decorators and processor#60
jimisola merged 2 commits intomainfrom
fix/bug-fixes-and-tests

Conversation

@jimisola
Copy link
Member

Summary

  • Fix 4 bugs found in main
  • Expand test coverage from 5 to 32 tests
  • Standardise code style from code review

Bug fixes

# Fix
1 Create missing src/reqstool_python_decorators/decorators/__init__.py
2 Fix broken import paths in test resources and README (src.reqstool_decoratorsreqstool_python_decorators)
3 Reset req_svc_results = [] at start of process_decorated_data() — prevented results doubling on repeated calls
4 Replace CPython repr-dependent str(type(node)).split(".")[-1][:-5].upper() with node.__class__.__name__[:-3].upper()

Tests

  • New tests/unit/reqstool_decorators/test_decorators.py — 7 tests for Requirements and SVCs decorators
  • Expanded test_processors.py — 32 tests covering all previously untested methods
  • Parametrized test_get_functions_and_classes_element_kind directly targets Fix 4 across all three node types
  • All fixtures standardised on tmp_path

Other

  • Add str | os.PathLike to all path/file parameters
  • Fix import examples and MIT License text in README

- 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
@jimisola jimisola merged commit 4b745a3 into main Mar 1, 2026
9 checks passed
@jimisola jimisola deleted the fix/bug-fixes-and-tests branch March 1, 2026 10:09
@jimisola jimisola self-assigned this Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant