Skip to content

Add test coverage for _toolkitAST module#20

Merged
hunterhogan merged 5 commits intomainfrom
copilot/add-tests-for-toolkitast
Oct 31, 2025
Merged

Add test coverage for _toolkitAST module#20
hunterhogan merged 5 commits intomainfrom
copilot/add-tests-for-toolkitast

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 31, 2025

Test Coverage for _toolkitAST Module

This PR adds comprehensive test coverage for the _toolkitAST module, which contains utility functions for parsing and extracting AST nodes.

Completed Work

  • Create test_toolkitAST.py following the existing test patterns
  • Add fixtures to tests/conftest.py for _toolkitAST test data
  • Test extractClassDef function with various scenarios
  • Test extractFunctionDef function with various scenarios
  • Test parseLogicalPath2astModule function with valid modules
  • Test parsePathFilename2astModule function with sample files
  • Run tests to verify coverage and correctness
  • Verify all tests pass and code quality checks pass
  • Address code review feedback
  • Resolve merge conflicts with main branch

Test Coverage Summary

Added 23 new tests covering all 4 functions in _toolkitAST:

  1. extractClassDef (5 tests)

    • Finding classes in parsed modules
    • Handling nonexistent classes
    • Multiple classes in same module
  2. extractFunctionDef (6 tests)

    • Finding functions in parsed modules
    • Handling nonexistent functions
    • Multiple functions in same module
    • Functions nested in classes
  3. parseLogicalPath2astModule (5 tests)

    • Parsing standard library modules
    • Parsing project modules
    • Type comments parameter
  4. parsePathFilename2astModule (4 tests)

    • Parsing from file paths
    • PathLike and string path support
    • Type comments parameter
  5. Integration scenarios (3 tests)

    • Combined parsing and extraction workflows
    • Multiple extractions from same module

All 892 tests pass (869 from main + 23 new).

Merge Conflict Resolution

Resolved conflict in tests/conftest.py by keeping both:

  • Grab test fixtures from main branch
  • _toolkitAST test fixtures from this PR
Original prompt

This section details on the original issue you should resolve

<issue_title>Test coverage: '_toolkitAST'</issue_title>
<issue_description>Create tests for the module '_toolkitAST'.</issue_description>

Comments on the Issue (you are @copilot in this section)

Note

Custom agent used: Tests
How to make tests.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 31, 2025 20:12
Co-authored-by: hunterhogan <2958419+hunterhogan@users.noreply.github.com>
Co-authored-by: hunterhogan <2958419+hunterhogan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test coverage for module '_toolkitAST' Add test coverage for _toolkitAST module Oct 31, 2025
Copilot AI requested a review from hunterhogan October 31, 2025 20:15
Copy link
Copy Markdown
Owner

@hunterhogan hunterhogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Resolve conflicts.

Co-authored-by: hunterhogan <2958419+hunterhogan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 31, 2025

@copilot Resolve conflicts.

Resolved merge conflict in tests/conftest.py by integrating both the Grab test fixtures from main and the _toolkitAST test fixtures from this PR. All 892 tests pass. (7592d62)

@hunterhogan hunterhogan marked this pull request as ready for review October 31, 2025 23:36
@hunterhogan hunterhogan merged commit 23dc414 into main Oct 31, 2025
9 checks passed
@hunterhogan hunterhogan deleted the copilot/add-tests-for-toolkitast branch October 31, 2025 23:36
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.

Test coverage: '_toolkitAST'

2 participants