Skip to content

fix: make google-cloud-monitoring tests work without mock#12317

Merged
parthea merged 2 commits into
googleapis:mainfrom
rominf:rominf-google-cloud-monitoring-remove-mock
Feb 15, 2024
Merged

fix: make google-cloud-monitoring tests work without mock#12317
parthea merged 2 commits into
googleapis:mainfrom
rominf:rominf-google-cloud-monitoring-remove-mock

Conversation

@rominf

@rominf rominf commented Feb 15, 2024

Copy link
Copy Markdown
Contributor

https://pypi.org/project/mock/ library is not needed anymore on modern
Python installation, since it is now part of the Python standard
library, available as unittest.mock.

Reuse approach used in generated tests/unit/gapic/monitoring_v3/ for
manually written tests/unit/test_query.py.

This issue and solution was found as a part of packaging the library for
Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=2263960.

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 a bug/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)

Fixes #12316 🦕

https://pypi.org/project/mock/ library is not needed anymore on modern
Python installation, since it is now part of the Python standard
library, available as `unittest.mock`.

Reuse approach used in generated `tests/unit/gapic/monitoring_v3/` for
manually written `tests/unit/test_query.py`.

This issue and solution was found as a part of packaging the library for
Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=2263960.
@rominf rominf marked this pull request as ready for review February 15, 2024 13:17
@rominf rominf requested a review from a team February 15, 2024 13:17
@parthea parthea enabled auto-merge (squash) February 15, 2024 15:29
@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 15, 2024
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 15, 2024
@parthea

parthea commented Feb 15, 2024

Copy link
Copy Markdown
Contributor

Thanks for the fix @rominf !

@parthea parthea merged commit 1988e0d into googleapis:main Feb 15, 2024
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.

google-cloud-monitoring tests depend on mock library which causes packaging problems on Fedora

2 participants