Skip to content

Commit

Permalink
fix: make google-cloud-monitoring tests work without mock (#12317)
Browse files Browse the repository at this point in the history
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:
- [x] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/google-cloud-python/issues)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)

Fixes #12316 🦕
  • Loading branch information
Roman Inflianskas committed Feb 15, 2024
1 parent aae7bf5 commit 1988e0d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/google-cloud-monitoring/tests/unit/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

import datetime
import unittest

import mock
from unittest import mock

from google.cloud import monitoring_v3 as monitoring_v3
from google.cloud.monitoring_v3 import MetricServiceClient
Expand Down

0 comments on commit 1988e0d

Please sign in to comment.