Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Switch to unittest.mock from mock#713

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

s-t-e-v-e-n-k
Copy link
Contributor

@s-t-e-v-e-n-ks-t-e-v-e-n-k commentedOct 2, 2024
edited by parthea
Loading

Now that the minimum supported version of Python is 3.7, we can stop using the external mock requirement, and import it from unittest. I have also attempted to keep imports ordered.

Fixes#377
Closes#676

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as abug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@s-t-e-v-e-n-ks-t-e-v-e-n-k requested review froma team ascode ownersOctober 2, 2024 03:53
@product-auto-labelproduct-auto-labelbot added the size: mPull request size is medium. labelOct 2, 2024
Now that the minimum supported version of Python is 3.7, we can stopusing the external mock requirement, and import it from unittest. I havealso attempted to keep imports ordered.Fixesgoogleapis#377
@ohmayr
Copy link
Contributor

@s-t-e-v-e-n-k, general comment:AsyncMock isn't part of the stdlib i.e.unitest.mock for Python 3.7. which we're using in our test code.

@s-t-e-v-e-n-k
Copy link
ContributorAuthor

Ahh, indeed, AsyncMock was added in 3.8. I'll modify this accordingly.

AsyncMock is not included in unittest.mock under Python 3.7, so we mustfallback to the external mock requirement for that Python version. Onlyinstall it for that version.Keep this as a separate commit so it can be reverted when 3.7 isn'tsupported anymore.
@partheaparthea self-assigned thisOct 9, 2024
@partheaparthea changed the titleSwitch to unittest.mock from mockfix: Switch to unittest.mock from mockOct 9, 2024
@partheaparthea merged commit8c53381 intogoogleapis:mainOct 9, 2024
36 checks passed
@release-pleaserelease-pleasebot mentioned this pull requestOct 9, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ohmayrohmayrohmayr approved these changes

Assignees

@partheaparthea

@ohmayrohmayr

Labels
size: mPull request size is medium.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

use unittest.mock instead of mock
3 participants
@s-t-e-v-e-n-k@ohmayr@parthea

[8]ページ先頭

©2009-2025 Movatter.jp