-
Notifications
You must be signed in to change notification settings - Fork 185
chore: format tests/unit/conftest.py with black #1522 #1584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: format tests/unit/conftest.py with black #1522 #1584
Conversation
|
Hi @Subhrasameerdash, this is **LinkBot** 👋
Linking pull requests to issues helps us significantly with reviewing pull requests and keeping the repository healthy. 🚨 This pull request does not have an issue linked. Please link an issue using the following format: 📖 Guide: If no issue exists yet, please create one: Thanks! |
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. To assist you, please read: Thank you for contributing! |
|
[commit-verification-bot] To achieve verified status, please read: Remember, you require a GPG key and each commit must be signed with: Thank you for contributing! From the Hiero Python SDK Team |
WalkthroughThe changes include formatting updates to the test configuration file using Black, addition of multiple new pytest fixtures for common test objects (IDs, credentials, mock client), and a changelog update documenting recent modifications including new documentation for a cryptography function. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/unit/conftest.py (1)
16-18: Remove duplicate import ofTokenId.
TokenIdis imported twice from the same module on lines 16 and 18. This is redundant and should be removed.🔧 Proposed fix
from hiero_sdk_python.tokens.token_id import TokenId from hiero_sdk_python.tokens.nft_id import NftId -from hiero_sdk_python.tokens.token_id import TokenId from hiero_sdk_python.transaction.transaction_id import TransactionId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR standardizes the formatting of tests/unit/conftest.py using Black and documents the change in the changelog, aligning with the repository’s ongoing test formatting cleanup.
Changes:
- Reformatted
tests/unit/conftest.pywith Black (multi-line return, consistent quotes, spacing, and trailing commas). - Added a changelog entry under “Tests” describing the new formatting for
tests/unit/conftest.py.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/unit/conftest.py | Reformats test fixtures to Black style (whitespace, line breaks, trailing commas, and quote consistency) without changing runtime behavior. |
| CHANGELOG.md | Adds a “Tests” section entry documenting the Black formatting of tests/unit/conftest.py. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
exploreriii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Subhrasameerdash thanks for asking for help!
Your commits are unverified because while you are signing with your GPG key, you forgot to tie it to github.
you can see that when you hover over the verified badge
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! You got close!
Please note your commits remain unverified because you have signed the commits with a different key id
Note here
https://github.com/hiero-ledger/hiero-sdk-python/pull/1584/commits
Hover over the verified and it will tell you what key id it expects, compare that to the key id on github
I recommend you soft revert your commits:
git reset --soft HEAD~2
ensure you use the GPG key tied to Github
recommit
git commit -S -s -m "chore: format conftest with black"
Any merge conflict can be solved on the online editor in the PR by accepting both changes :)
7ca7f5c to
106a162
Compare
exploreriii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please double check your key!
https://github.com/hiero-ledger/hiero-sdk-python/pull/1584/commits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
|
@Subhrasameerdash just address the changes requested and duplicate entries in CHANGELOG.md , everything else LGTM ! |
9b5205a to
397ff7e
Compare
|
@prajeeta15 I have made the required changes. Please check and verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/unit/conftest.py (1)
28-43: Scope creep vs. formatting-only objective.Issue
#1522requires formatting-only changes, but this PR adds new fixtures and behaviors. Please confirm this is intended, or split functional additions into a separate PR to meet the acceptance criteria.
♻️ Duplicate comments (1)
CHANGELOG.md (1)
15-20: Remove duplicate changelog entries.Line 15 duplicates Line 17, and Line 16 duplicates Line 20. Please keep only one entry per change.
🧾 Suggested fix
- Format `tests/unit/network_tls_test.py` with black for code style consistency (`#1543`) - Format `tests/unit/conftest.py` with black for code style consistency. (`#1522`) - Format tests/unit/network_tls_test.py with black for code style consistency (`#1543`) + Format `tests/unit/network_tls_test.py` with black for code style consistency (`#1543`) + Format `tests/unit/conftest.py` with black for code style consistency. (`#1522`) ... - Format `tests/unit/conftest.py` with black for code style consistency. (`#1522`)
|
@Subhrasameerdash please look into the coderabbitai issues. |
|
@Subhrasameerdash Thank you so much for your contribution! This is truly great work!! Please be sure to address merge conflicts. We are excited to see contributors wanting to take on more advanced tasks. We look forward to seeing more contributions and thank you! |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1584 +/- ##
=======================================
Coverage 92.89% 92.89%
=======================================
Files 140 140
Lines 8765 8765
=======================================
Hits 8142 8142
Misses 623 623 🚀 New features to boost your workflow:
|
I have updated the merge conflicts |
Thank you for the feedback and encouragement! I have resolved the merge conflicts. I'm also interested in tackling #1449 - I'll comment on that issue to get assigned. Thanks again for the opportunity to contribute! |
|
Hi @Subhrasameerdash please resolve the conflicts, then this is ready to go 👍 |
|
Hii @exploreriii i have resolved the conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/unit/node_tls_test.py (1)
357-365:⚠️ Potential issue | 🔴 CriticalFix malformed with-block in certificate-missing test.
The unindented line inside the
with pytest.raises(...)block is a SyntaxError. Keep the newenabled=Truecall and remove the stray line.🛠️ Proposed fix
def test_secure_connect_raise_error_if_no_certificate_is_available( mock_node_without_address_book, ): """Test get channel raise error if no certificate available if transport security true.""" node = mock_node_without_address_book node._apply_transport_security(enabled=True) with pytest.raises(ValueError, match=r"No certificate available\."): - node._apply_transport_security(True) - - with pytest.raises(ValueError, match="No certificate available."): node._get_channel()
prajeeta15
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Subhrasameerdash please look into the duplicate parameters.
exploreriii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Subhrasameerdash
Thank you for this PR
However, I cannot accept the PR until it satisfies the issue description
The issue was just to format conftest.py, but here in your PR I see changes to node_tls_test.py
https://github.com/hiero-ledger/hiero-sdk-python/pull/1584/changes#r2746926549
Please revert all non-relevant changes and then request a review again 👍
Thank you for your understanding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/unit/node_tls_test.py (1)
354-365:⚠️ Potential issue | 🔴 CriticalCritical syntax error - test file will not parse.
The test has invalid Python syntax that prevents pytest from collecting this file:
- Line 360 opens a
with pytest.raises(...)block, but line 361 (node._apply_transport_security(True)) is not indented under it- Python raises
IndentationError: expected an indented block after 'with' statement- Lines 359-361 appear to be an incomplete/duplicate version overlapping with the intended test at lines 363-364
Remove the redundant lines 360-362 and keep only the properly indented version:
Fix
def test_secure_connect_raise_error_if_no_certificate_is_available( mock_node_without_address_book, ): """Test get channel raise error if no certificate available if transport security true.""" node = mock_node_without_address_book node._apply_transport_security(enabled=True) - with pytest.raises(ValueError, match=r"No certificate available\."): - node._apply_transport_security(True) with pytest.raises(ValueError, match=r"No certificate available\."): node._get_channel()
Hi @exploreriii I have made the necessary changes. |
exploreriii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still showing many changes to node_tls_test.py
https://github.com/hiero-ledger/hiero-sdk-python/pull/1584/changes
try to soft revert your commits then only commit again the conftet and changelog, discard any change to node tls test
git reset --soft HEAD~19
git commit -S -s -m "chore: format conftest"
git commit -S -s -m "chore: format conftest changelog entry"
git push --forceSigned-off-by: SubhraSameerDash <[email protected]>
Signed-off-by: SubhraSameerDash <[email protected]>
a01df0f to
9cbc175
Compare
Signed-off-by: Subhra Sameer Dash <[email protected]>
rwalworth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @Subhrasameerdash for your contribution. Recommend merging @exploreriii
|
🎉 Nice work completing a Good First Issue! Thank you for your contribution to the Hiero Python SDK! We're excited to have you as part of our community. Here are some issues labeled Beginner you might be interested in working on next:
🌟 Stay connected with the project:
We look forward to seeing more contributions from you! If you have any questions, feel free to ask in our Discord community. From the Hiero Python SDK Team 🚀 |
Description:
Fixes #1522
Notes for reviewer:
Checklist