Skip to content

Fix/test pollution and math animator#393

Open
zbinxp wants to merge 2 commits intoHKUDS:mainfrom
zbinxp:fix/test-pollution-and-math-animator-v2
Open

Fix/test pollution and math animator#393
zbinxp wants to merge 2 commits intoHKUDS:mainfrom
zbinxp:fix/test-pollution-and-math-animator-v2

Conversation

@zbinxp
Copy link
Copy Markdown
Contributor

@zbinxp zbinxp commented Apr 26, 2026

Description

Fix pytest failures

Fix 1 — tests/core/test_capabilities_runtime.py — _install_module now copies existing attributes from the real module before applying test-specific overrides, preventing submodules like context_window_detection from being wiped out.

Fix 2 — deeptutor/capabilities/math_animator.py — answer_now_context is now extracted from config_overrides before validation, since MathAnimatorRequestConfig has extra="forbid" and rejects unknown fields.

Related Issues

  • Closes #...
  • Related to #...

Module(s) Affected

  • agents
  • api
  • config
  • core
  • knowledge
  • logging
  • services
  • tools
  • utils
  • web (Frontend)
  • docs (Documentation)
  • scripts
  • tests
  • Other: ...

Checklist

  • I have read and followed the contribution guidelines.
  • My code follows the project's coding standards.
  • I have run pre-commit run --all-files and fixed any issues.
  • I have added relevant tests for my changes.
  • I have updated the documentation (if necessary).
  • My changes do not introduce any new security vulnerabilities.

Additional Notes

Add any other context or screenshots about the pull request here.

zbinxp and others added 2 commits April 26, 2026 12:18
The test mock for _cli_kit was missing the `spinner` entry, causing
ImportError when start_tour.py tried to import it. Also adds SCRIPTS_ROOT
to sys.path so _cli_kit can be resolved when imported from the scripts/
subdirectory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The _install_module helper in test_capabilities_runtime.py was creating a
brand-new ModuleType for deeptutor.services.config, wiping out existing
submodules like context_window_detection. This caused downstream tests to
fail with AttributeError when they tried to import from that submodule.

Also fixes math_animator capability: extract answer_now_context from
config_overrides before validating, since it is a transport wrapper field
not a MathAnimatorRequestConfig field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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