Skip to content

test(python): Add tests for python sdk#3432

Open
slbotbm wants to merge 1 commit into
apache:masterfrom
slbotbm:python-testing
Open

test(python): Add tests for python sdk#3432
slbotbm wants to merge 1 commit into
apache:masterfrom
slbotbm:python-testing

Conversation

@slbotbm
Copy link
Copy Markdown
Contributor

@slbotbm slbotbm commented Jun 7, 2026

Which issue does this PR address?

Closes #3317
Relates to #

Rationale

The python sdk only had a few happy path tests. This PR adds extensive testing for the sdk. Also explicitly maps errors, replacing unwraps.

What changed?

  • added extensive tests, divided into files. Division was done to separate concerns.
  • removed all usage of unwrap in the the rust code.
  • moved code of iterator.rs into consumer.rs. No need for an extra file for a small amount of code.

Local Execution

  • Passed
  • Pre-commit hooks

AI Usage

If AI tools were used, please answer:

  1. Which tools? codex
  2. Scope of usage? code generation, investigation
  3. How did you verify the generated code works correctly? read through and reasoned about the code, executed on my machine
  4. Can you explain every line of the code if asked? Yes

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2026

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jun 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2026

Codecov Report

❌ Patch coverage is 87.30159% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.48%. Comparing base (d254604) to head (66a44c2).

Files with missing lines Patch % Lines
foreign/python/src/consumer.rs 84.61% 4 Missing ⚠️
foreign/python/src/identifier.rs 71.42% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3432      +/-   ##
============================================
+ Coverage     74.43%   74.48%   +0.04%     
  Complexity      943      943              
============================================
  Files          1245     1244       -1     
  Lines        121293   121309      +16     
  Branches      97599    97599              
============================================
+ Hits          90285    90353      +68     
+ Misses        28054    28002      -52     
  Partials       2954     2954              
Components Coverage Δ
Rust Core 75.56% <ø> (ø)
Java SDK 58.44% <ø> (ø)
C# SDK 69.92% <ø> (ø)
Python SDK 89.74% <87.30%> (+8.67%) ⬆️
PHP SDK 83.57% <ø> (ø)
Node SDK 91.35% <ø> (ø)
Go SDK 40.20% <ø> (ø)
Files with missing lines Coverage Δ
foreign/python/src/client.rs 97.62% <100.00%> (+5.76%) ⬆️
foreign/python/src/lib.rs 100.00% <ø> (ø)
foreign/python/src/send_message.rs 96.96% <100.00%> (+0.67%) ⬆️
foreign/python/src/consumer.rs 80.58% <84.61%> (+19.16%) ⬆️
foreign/python/src/identifier.rs 77.77% <71.42%> (-2.23%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand Python SDK test coverage

1 participant