Skip to content

fix: detect async def test_ functions in project inspector#42

Open
Nelson Spence (Fieldnote-Echo) wants to merge 1 commit intomainfrom
fix/async-test-detection
Open

fix: detect async def test_ functions in project inspector#42
Nelson Spence (Fieldnote-Echo) wants to merge 1 commit intomainfrom
fix/async-test-detection

Conversation

@Fieldnote-Echo
Copy link
Member

The regex in detect_test_info only matched synchronous def test_* functions,
missing async def test_* functions used with pytest-asyncio.

Updates the regex to use (?:async\s+)? and adds a test covering the async case.

Fixes #32


Recreated from #34 by Raghu :) (@RogueTex) — original was reverted during CI infrastructure work. See comment below for context.

Co-Authored-By: RogueTex RogueTex@users.noreply.github.com

The regex only matched synchronous `def test_*` functions, missing
`async def test_*` functions used with pytest-asyncio.

Fixes #32

Co-Authored-By: RogueTex <RogueTex@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes test function counting in the project inspector by updating detect_test_info to recognize async def test_* functions (e.g., pytest-asyncio), and adds regression coverage for the async case.

Changes:

  • Update test-function detection regex to match both def test_ and async def test_.
  • Add a unit test ensuring async test functions are included in the detected test_count.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/navi_bootstrap/init.py Expands the regex used by detect_test_info to include async test functions.
tests/test_init.py Adds coverage to ensure async test functions are counted.

@github-actions
Copy link
Contributor

✅ Grippy Review — PASS

Score: 100/100 | Findings: 0


Commit: afa8d82

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

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

All required CI checks passed. Auto-approved by navi-bot.

Copy link
Collaborator

@project-navi-bot project-navi-bot left a comment

Choose a reason for hiding this comment

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

All required CI checks passed. Auto-approved by navi-bot.

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.

Fix async test function detection in project inspector

3 participants