-
Notifications
You must be signed in to change notification settings - Fork 92
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
Fix deprecated usage of pytest #235
Conversation
WalkthroughThe update involves refining the naming convention for setup and teardown methods within a test class, aiming to enhance consistency and readability. These adjustments signify a shift towards a more standardized approach in managing test preparations and conclusions. Additionally, a modification in Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- tests/test_aio.py (1 hunks)
Additional comments: 2
tests/test_aio.py (2)
- 319-319: The method
setup_method
correctly follows pytest's updated naming conventions for setup operations in test classes. This change ensures compatibility with the latest versions of pytest and improves the clarity of the test code.- 326-326: The method
teardown_method
has been correctly renamed to align with pytest's updated naming conventions for teardown operations in test classes. This adjustment enhances the maintainability of the test suite by adhering to standardized practices.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- tests/test_aio.py (2 hunks)
- tests/test_rpc.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- tests/test_aio.py
Additional comments: 1
tests/test_rpc.py (1)
- 253-254: The modification to the
test_client_timeout
function, specifically changing the timeout value, is a straightforward approach to address the deprecated warning related to client instantiation with a timeout. This change ensures that the test aligns with the intended behavior of testing client timeout functionality. However, it's crucial to verify that this adjustment does not inadvertently affect other tests or the overall test suite's reliability.
@@ -250,9 +250,8 @@ def test_exception_iwth_ssl(): | |||
|
|||
def test_client_timeout(): | |||
with pytest.raises(socket.timeout): | |||
with pytest.warns(UserWarning): # Deprecated |
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 UserWarning
is never been raised, but the older version of pytest will ignore the failure when it't in a with pytest.raises(...)
context.
So we should just remove it.
Since this is a trival change which keeps the CI healthy, I'll merge it after the CI passed. cc @ethe |
Details:
About the change in the
test_rpc.py
, see the comment below.Summary by CodeRabbit
Summary by CodeRabbit
test_client_timeout
function related to client instantiation.