Skip to content
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

refactor: replace repeated patches of snowflake.connector.connect… #2002

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfc-gh-jwilkowski
Copy link

@sfc-gh-jwilkowski sfc-gh-jwilkowski commented Jan 17, 2025

… with a fixture

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.

Changes description

proposal for a minor refactor of 1 fixture

@@ -31,11 +31,10 @@
@mock.patch("snowflake.cli._app.telemetry.platform.platform")
@mock.patch("uuid.uuid4")
@mock.patch("snowflake.cli._app.telemetry.get_time_millis")
@mock.patch("snowflake.connector.connect")
Copy link
Author

@sfc-gh-jwilkowski sfc-gh-jwilkowski Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. patches need to be provided in test function arguments in reverse order, which is a bit less convenient than just passing a fixture name
  2. With a single fixture, it's easier to account for any changes to name/location of connector.connect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant