Skip to content

fix: ensure pytest imports from local src/#442

Open
jwm4 wants to merge 1 commit into
ambient-code:mainfrom
jwm4:fix/pytest-pythonpath
Open

fix: ensure pytest imports from local src/#442
jwm4 wants to merge 1 commit into
ambient-code:mainfrom
jwm4:fix/pytest-pythonpath

Conversation

@jwm4
Copy link
Copy Markdown
Contributor

@jwm4 jwm4 commented May 18, 2026

Summary

  • Adds pythonpath = ["src"] to [tool.pytest.ini_options] in pyproject.toml
  • Ensures pytest always resolves imports from the local source tree, not a globally installed copy of agentready
  • Without this, contributors who have agentready installed (via pip or an editable install in another directory) silently run tests against the wrong copy

One-line change, zero impact on contributor workflow.

This PR was created by Bill Murdock with assistance from Claude Code.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated test environment configuration to optimize testing setup.

Add pythonpath = ["src"] to pytest config so tests always resolve
imports from the local source tree. Without this, contributors who
have agentready installed globally or in another clone will silently
run tests against the wrong copy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: b9f018f7-8807-4359-9f87-6ece120ed9d0

📥 Commits

Reviewing files that changed from the base of the PR and between fbf185a and 11225c9.

📒 Files selected for processing (1)
  • pyproject.toml

📝 Walkthrough

Walkthrough

This PR adds a single pytest configuration line to resolve imports from the src/ directory during test runs. The change ensures tests can import application code using expected paths without additional sys.path manipulation.

Changes

Pytest Configuration

Layer / File(s) Summary
Pytest pythonpath configuration
pyproject.toml
Added pythonpath = ["src"] to [tool.pytest.ini_options] to configure pytest's import resolution for the src/ directory structure.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits format with 'fix' type and clearly describes the main change: configuring pytest to import from the local src/ directory.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

📈 Test Coverage Report

Branch Coverage
This PR 73.6%
Main 73.6%
Diff ✅ +0%

Coverage calculated from unit tests only

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