Skip to content

feat: Refactor Transaction Test - #2627

Open
aceppaluni wants to merge 1 commit into
hiero-ledger:mainfrom
aceppaluni:testsRefactor
Open

feat: Refactor Transaction Test#2627
aceppaluni wants to merge 1 commit into
hiero-ledger:mainfrom
aceppaluni:testsRefactor

Conversation

@aceppaluni

Copy link
Copy Markdown
Contributor

Description:

Refactor tests/unit/transaction_test.py to reuse the existing shared fixtures from conftest.py instead of defining duplicate fixtures locally.

Changes

  • Removed the locally defined file_id, account_id, and transaction_id fixtures from tests/unit/transaction_test.py.
  • Updated affected tests to use the shared fixtures provided by conftest.py.
  • Reused mock_account_ids where multiple account IDs are required instead of creating additional local fixtures.
  • Removed imports that are no longer needed after removing the duplicate fixtures.
  • Verified the transaction unit tests pass successfully.

Related issue(s):

Fixes #2544

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: aceppaluni <aceppaluni@gmail.com>
@aceppaluni
aceppaluni requested review from a team as code owners August 29, 2026 21:58
@github-actions github-actions Bot added approved Issue has been approved by team member skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues labels Aug 29, 2026
@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2627   +/-   ##
=======================================
  Coverage   95.47%   95.47%           
=======================================
  Files         165      165           
  Lines       10604    10604           
=======================================
  Hits        10124    10124           
  Misses        480      480           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aceppaluni aceppaluni removed the approved Issue has been approved by team member label Aug 29, 2026
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d35ac920-716b-4f3d-9d71-7918b1d9ed75

📥 Commits

Reviewing files that changed from the base of the PR and between dfbbf4e and 0151336.

📒 Files selected for processing (1)
  • tests/unit/transaction_test.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The transaction unit tests replace removed local account fixtures with the shared mock_account_ids fixture. Tests use the node account ID for transaction setup and the operator account ID for default fee validation.

Changes

Transaction test fixture reuse

Layer / File(s) Summary
Migrate transaction tests to shared account IDs
tests/unit/transaction_test.py
Transaction size, chunking, high-volume, and default-fee tests unpack or index mock_account_ids instead of using the removed account_id fixture.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 01513

This change only removes duplicate test fixtures and reuses existing shared fixtures in the transaction tests; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: refactoring the transaction test.
Description check ✅ Passed The description directly explains the fixture refactor, removed imports, test updates, and validation steps.
Linked Issues check ✅ Passed The changes satisfy issue #2544 by removing duplicate fixtures, reusing mock_account_ids, removing unnecessary imports, and limiting changes to tests/unit/transaction_test.py.
Out of Scope Changes check ✅ Passed The changes are limited to tests/unit/transaction_test.py and align with the linked issue objectives. No unrelated changes are identified.
Docstring Coverage ✅ Passed Docstring coverage is 94.44% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 1 files.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added open to community review PR is open for community review and feedback queue:junior-committer PR awaiting initial quality review labels Aug 29, 2026
@github-actions github-actions Bot added queue:committers PR awaiting committer technical review and removed queue:junior-committer PR awaiting initial quality review labels Aug 31, 2026
@github-actions github-actions Bot added status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge and removed queue:committers PR awaiting committer technical review labels Sep 1, 2026
@manishdait manishdait added the status: update branch developer needs to click update branch label Sep 1, 2026
@manishdait

Copy link
Copy Markdown
Contributor

@aceppaluni, please update the branch :)

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Requesting triage review from: @hiero-ledger/hiero-sdk-python-triage

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

Labels

open to community review PR is open for community review and feedback skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge status: update branch developer needs to click update branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor tests/unit/transaction_test.py to Reuse Existing Fixtures

4 participants