Skip to content

[codex] Isolate available plans Stripe imports#7945

Open
tianmind-studio wants to merge 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-available-plans-stripe-stub
Open

[codex] Isolate available plans Stripe imports#7945
tianmind-studio wants to merge 1 commit into
BasedHardware:mainfrom
tianmind-studio:codex/windows-available-plans-stripe-stub

Conversation

@tianmind-studio

Copy link
Copy Markdown
Contributor

Summary

  • Stub the Stripe module inside test_available_plans_resilience.py so the available-plans tests collect without the optional Stripe SDK installed.
  • Restore the real backend/utils package path before importing routers.payment, while still stubbing heavy BYOK/external modules used only as import dependencies.
  • Keep the tests exercising the real get_available_plans_endpoint behavior with explicit per-test Stripe method mocks.

Why

On a lightweight Windows backend test environment, collecting this test file failed at import stripe. When another lightweight test ran first, it could also leave a stubbed utils package with no filesystem path, causing utils.subscription import failures. This PR makes the test self-contained and order-tolerant without changing production code.

Validation

  • python -m pytest backend\tests\unit\test_available_plans_resilience.py --collect-only -q --tb=short
  • python -m pytest backend\tests\unit\test_available_plans_resilience.py -q --tb=short
  • python -m pytest backend\tests\unit\test_action_item_date_validation.py backend\tests\unit\test_available_plans_resilience.py -q --tb=short
  • python -m pytest backend\tests\unit\test_available_plans_resilience.py backend\tests\unit\test_action_item_date_validation.py -q --tb=short
  • python -m black --line-length 120 --skip-string-normalization backend\tests\unit\test_available_plans_resilience.py
  • python -m py_compile backend\tests\unit\test_available_plans_resilience.py
  • git diff --check
  • scripts\pre-commit

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