Skip to content

docs: testing patterns + Python 3.13 deprecation notes (v1.9.1)#38

Merged
simons-plugins merged 2 commits into
mainfrom
feat/2025.2-python-313-testing-docs
May 4, 2026
Merged

docs: testing patterns + Python 3.13 deprecation notes (v1.9.1)#38
simons-plugins merged 2 commits into
mainfrom
feat/2025.2-python-313-testing-docs

Conversation

@simons-plugins
Copy link
Copy Markdown
Owner

@simons-plugins simons-plugins commented May 4, 2026

Summary

Picks up where #(the v1.9.0 docs PR) left off. Adds two pieces of guidance the skill was missing for Indigo 2025.2 / Python 3.13:

  • New docs/plugin-dev/patterns/testing.md — documents the two complementary testing patterns:

    • Pattern A: unit tests with unittest.mock (fast, no Indigo install, runs in CI)
    • Pattern B: live integration tests with the upstream TestingBase submodule (`APIBase` + `ValidateXmlFile` against a running Indigo server)
    • Side-by-side comparison and concrete setup snippets for both.
  • reference/Python3-Migration-Guide.md — appends an Indigo 2025.2 / Python 3.11 → 3.13 section. Complements the library-specific 2025.2 entries already in `troubleshooting/common-issues.md` (telnetlib, websockets, matplotlib) with the generic 3.13 deprecations: `datetime.utcnow`, `asyncio.get_event_loop`, `pkg_resources`, the PEP 594 stdlib removals, and the `imp`/`distutils` removals from 3.12.

  • Routing — `/indigo:dev` (`commands/dev.md` + `skills/dev/SKILL.md`) now surfaces the testing doc on prompts mentioning test, pytest, mocking, or TestingBase.

  • Version bump: `1.9.0 → 1.10.0` in both `plugin.json` and `marketplace.json` (minor — new docs surface).

Test plan

  • CI `Check Version Bump` passes (plugin.json/marketplace.json synced at 1.10.0, differs from main 1.9.0)
  • `/indigo:dev` surfaces `patterns/testing.md` for prompts like "how do I test my plugin?" or "TestingBase setup"
  • Cross-links from migration guide to common-issues anchor and to patterns/testing.md resolve
  • testing.md renders cleanly on GitHub

Summary by CodeRabbit

  • Documentation

    • Added comprehensive testing patterns guide for plugin developers, covering unit testing and integration testing approaches.
    • Added Python 3.11 to 3.13.9 migration guide with deprecation warnings and removal notices for the 2025.2 upgrade path.
    • Updated developer documentation to reference new testing and migration resources.
  • Chores

    • Bumped plugin version to 1.10.0.

…13 deprecation notes

Fills two gaps in the skill after the 1.9.0 docs pass:

- New patterns/testing.md covers Pattern A (unit tests with mocked indigo
  via unittest.mock) and Pattern B (live integration with TestingBase
  submodule + APIBase + ValidateXmlFile). Documents both as
  complementary, with a side-by-side comparison and setup instructions.
- Python3-Migration-Guide.md gains an "Indigo 2025.2 / Python 3.11 →
  3.13" section covering generic 3.13 deprecations not specific to a
  particular library: datetime.utcnow, asyncio.get_event_loop,
  pkg_resources, the PEP 594 stdlib removals (cgi/telnetlib/etc.), and
  the imp/distutils removals from 3.12. Cross-links to the existing
  troubleshooting section for library-specific breakages.
- /indigo:dev routing (commands/dev.md + skills/dev/SKILL.md) now
  surfaces the testing doc on prompts mentioning "test", "pytest",
  "mocking", or "TestingBase".
- Bump plugin.json + marketplace.json to 1.10.0 (minor — new docs
  surface).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

📝 Walkthrough

Walkthrough

Plugin version incremented from 1.9.0 to 1.10.0 across manifest files. Two new documentation files added: testing patterns guide covering unit tests and integration testing with TestingBase, and Python 3.11→3.13 migration guide for Indigo 2025.2. Documentation routing tables updated to reference new content.

Changes

Version 1.10.0 Release with Documentation Additions

Layer / File(s) Summary
Version Manifest
.claude-plugin/marketplace.json, .claude-plugin/plugin.json
Plugin version incremented from 1.9.0 to 1.10.0 in both manifest files.
Testing Patterns Documentation
docs/plugin-dev/patterns/testing.md
New file introducing two complementary testing patterns: mocked unit tests using unittest.mock for CI-friendly testing, and live integration tests using TestingBase with APIBase and XML validation; includes fixture examples, repo layout guidance, and pattern comparison.
Python 3 Migration Guide
reference/Python3-Migration-Guide.md
New section "Indigo 2025.2 / Python 3.11 → 3.13" covering library breakages, deprecations to address, PEP 594 stdlib removals, vendored package rebuild strategy, verification steps, and rollback instructions.
Documentation Routing & References
commands/dev.md, skills/dev/SKILL.md
Development guide updated with testing patterns entry in "Safe to Load" table, "Concepts vs API vs Patterns" routing, and step-by-step "How do I test?" section; skill reference documentation expanded to include testing patterns link.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 Version hops from nine to ten,
Testing patterns guide us then,
Python three-point-thirteen calls,
New docs light up our plugin halls!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title mentions testing patterns and Python 3.13, which align with the main changes, but uses version v1.9.1 while the actual changes update to v1.10.0. Update the title to reflect the correct version (v1.10.0) or remove the version number. For example: 'docs: add testing patterns and Python 3.13 deprecation guide' or 'docs: testing patterns + Python 3.13 deprecation notes (v1.10.0)'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/2025.2-python-313-testing-docs

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/plugin-dev/patterns/testing.md (1)

12-45: ⚡ Quick win

Make Pattern A’s indigo mocking concrete (add a sys.modules patch example).

Pattern A says to mock indigo and then import the plugin module directly, but the “reference shape” snippet only provides mock_logger() and doesn’t demonstrate the critical step: patching sys.modules["indigo"] (or otherwise ensuring imports succeed without Indigo).

Add a minimal example showing how to wrap the plugin import with patch.dict(sys.modules, {"indigo": ...}) (module path can be a placeholder).

✅ Proposed fix (doc snippet)
 import sys
 from pathlib import Path
-from unittest.mock import Mock
+from unittest.mock import Mock, patch
 import pytest

 ...

 `@pytest.fixture`
 def mock_logger():
     logger = Mock()
     for level in ("debug", "info", "warning", "error", "exception"):
         setattr(logger, level, Mock())
     return logger

+@pytest.fixture
+def mock_indigo():
+    # Provide only the attributes your plugin touches at import/runtime.
+    return Mock()

And update the narrative around Line 44 to explicitly say something like:

“Wrap your import with patch.dict(sys.modules, {"indigo": mock_indigo}) so the plugin can be imported without an Indigo install.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/plugin-dev/patterns/testing.md` around lines 12 - 45, Add a concrete
example showing how to patch sys.modules before importing the plugin so imports
of the indigo package succeed: update tests/conftest.py (alongside existing
SERVER_PLUGIN_DIR and mock_logger fixture) to create a mock_indigo module and
use patch.dict(sys.modules, {"indigo": mock_indigo}) around the import of your
plugin, and update the narrative near the existing reference to say “Wrap your
import with patch.dict(sys.modules, {'indigo': mock_indigo}) so the plugin can
be imported without an Indigo install.” Ensure you reference the mock_indigo
object when describing the patch and keep the change adjacent to the mock_logger
fixture/example.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/plugin-dev/patterns/testing.md`:
- Around line 62-80: Two fenced code blocks in the docs (the directory tree
block starting with "my-plugin/" and the requirements snippet starting with "-r
shared/module-requirements.txt") lack language identifiers causing MD040; add a
language tag (e.g., ```text) to both fenced code blocks so they become ```text
... ``` to satisfy markdownlint and improve readability.

---

Nitpick comments:
In `@docs/plugin-dev/patterns/testing.md`:
- Around line 12-45: Add a concrete example showing how to patch sys.modules
before importing the plugin so imports of the indigo package succeed: update
tests/conftest.py (alongside existing SERVER_PLUGIN_DIR and mock_logger fixture)
to create a mock_indigo module and use patch.dict(sys.modules, {"indigo":
mock_indigo}) around the import of your plugin, and update the narrative near
the existing reference to say “Wrap your import with patch.dict(sys.modules,
{'indigo': mock_indigo}) so the plugin can be imported without an Indigo
install.” Ensure you reference the mock_indigo object when describing the patch
and keep the change adjacent to the mock_logger fixture/example.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 32b2a6d9-71f3-4853-ac3e-3983dee01b86

📥 Commits

Reviewing files that changed from the base of the PR and between ef0d327 and 6f081ab.

📒 Files selected for processing (6)
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • commands/dev.md
  • docs/plugin-dev/patterns/testing.md
  • reference/Python3-Migration-Guide.md
  • skills/dev/SKILL.md

Comment on lines +62 to +80
**Layout** (the convention TestingBase expects):

```
my-plugin/
├── tests/
│ ├── shared/ # submodule — do NOT edit
│ ├── .env # gitignored — Indigo API credentials
│ ├── testing-requirements.txt # references shared/module-requirements.txt
│ ├── venv/ # gitignored — your test venv
│ └── test_my_plugin.py
```

`tests/.env` carries credentials — see `tests/shared/ENV_TEMPLATE` for the exact keys. `tests/testing-requirements.txt` should chain to the shared list:

```
-r shared/module-requirements.txt
# anything else your tests need
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add language identifiers to unlabeled fenced code blocks (MD040).

markdownlint-cli2 is flagging fenced blocks without a language at Line 64 and Line 76. Add a language tag (e.g., text) to avoid lint failures and improve readability.

✅ Proposed fix
-```
+```text
 my-plugin/
 ├── tests/
 │   ├── shared/                       # submodule — do NOT edit
 │   ├── .env                          # gitignored — Indigo API credentials
 │   ├── testing-requirements.txt      # references shared/module-requirements.txt
 │   ├── venv/                         # gitignored — your test venv
 │   └── test_my_plugin.py

...

- +text
-r shared/module-requirements.txt

anything else your tests need

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 64-64: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 76-76: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/plugin-dev/patterns/testing.md` around lines 62 - 80, Two fenced code
blocks in the docs (the directory tree block starting with "my-plugin/" and the
requirements snippet starting with "-r shared/module-requirements.txt") lack
language identifiers causing MD040; add a language tag (e.g., ```text) to both
fenced code blocks so they become ```text ... ``` to satisfy markdownlint and
improve readability.

… idiom, downgrade to 1.9.1

Review findings on PR #38:

- reference/Python3-Migration-Guide.md: asyncio.get_event_loop()
  DeprecationWarning was added in 3.12 (cpython gh-100160), not 3.10.
  Fixed.
- reference/Python3-Migration-Guide.md: PEP 594 list was missing
  cgitb and msilib (verified against the 3.13 What's New). Added.
- reference/Python3-Migration-Guide.md: dropped unverified specific
  patch claim "3.13.9" to plain "3.13".
- docs/plugin-dev/patterns/testing.md: ValidateXmlFile example used
  a hardcoded absolute path which fails across machines. Switched
  to upstream's os.path-relative idiom.
- docs/plugin-dev/patterns/testing.md: clarified APIBase is abstract
  (not just any TestCase) so readers don't try to instantiate it.
- docs/plugin-dev/patterns/testing.md: refined "Slow (spawns processes
  per call)" — only run_host_script-based helpers spawn IPH3, not
  every assertion. Plain HTTP calls are just round-trips.
- docs/plugin-dev/patterns/testing.md: added one-line clarifying
  comment to the mock_logger fixture explaining the explicit assigns
  are for readability (Mock auto-creates attrs on access).
- docs/plugin-dev/patterns/README.md: added Testing entry to the
  index — was the only discoverability surface missed in the
  initial PR.
- .claude-plugin/{plugin,marketplace}.json: scope-correct version
  bump 1.10.0 → 1.9.1. Pure docs additions are patch territory per
  the workspace memory rule (minor for user-visible features, patch
  for internal/reliability work).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@simons-plugins simons-plugins changed the title docs: testing patterns + Python 3.13 deprecation notes (v1.10.0) docs: testing patterns + Python 3.13 deprecation notes (v1.9.1) May 4, 2026
@simons-plugins simons-plugins merged commit 5e226a3 into main May 4, 2026
3 checks passed
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