Skip to content

fix: emit payment method deprecation warnings without crashing - #170

Open
Shubham-Padkonde wants to merge 1 commit into
braintree:masterfrom
Shubham-Padkonde:fix/payment-method-deprecation-warnings
Open

Shubham-Padkonde wants to merge 1 commit into
braintree:masterfrom
Shubham-Padkonde:fix/payment-method-deprecation-warnings

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Summary

Fixes #166. Payment method creation with device_session_id, and updates with supported legacy attributes, currently raise NameError before dispatching the request because warnings is not imported.

Import warnings so these paths issue the existing DeprecationWarning and continue as intended. Keep the legacy attributes and warning messages intact. The regression tests exercise creation plus three update attributes and verify that the original parameters and result are forwarded through the mocked request methods.

Validation:

  • All four regression scenarios fail with NameError before the fix.
  • Linux Python 3.12.13: all 560 unit tests pass.
  • Windows Python 3.12.6: all 13 payment-method tests pass. The full suite runs 560 tests with one failure in the existing test_setup path-separator comparison.
  • git diff --check passes.
  • No live payment requests or private integration-server tests were run.

Prepared with Codex assistance.

Checklist

  • Added changelog entry
  • New test methods are alphabetized; existing class members were not reordered
  • Ran unit tests (python3 -m unittest discover tests/unit) successfully on Linux
  • JIRA ticket linked and acceptance criteria reviewed — external contribution for GitHub issue Undefined warning variable #166; no internal JIRA access
  • This is submitted as ready for review and deployment if accepted

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.

Undefined warning variable

1 participant