refactor: Convert test_cloud.py from unittest mock.patch to pytest mocker #498
+25
−32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Converted
tests/unit_tests/test_cloud.pyfrom unittest-style mocking to pytest-style using themockerfixture frompytest-mock, and incremented the package version.Changes Made
mockimport and@mock.patchdecorators: Replaced all 7 test methods using@mock.patchdecorators withmocker.patch()calls inside test functionsmockerfixture parameter to affected tests, removed decorator-injected mock parameters1!10.16.0to1!10.16.1Example
Before:
After:
Additional Context and Relevant Issues
Part of broader effort to standardize test patterns across the codebase. No behavior changes—all 319 unit tests pass. All GitHub workflows validated (ruff, mypy, pytest, docs, version_check).
Test Steps
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.