Skip to content

Commit 1988e0d

Browse files
author
Roman Inflianskas
authored
fix: make google-cloud-monitoring tests work without mock (#12317)
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 🦕
1 parent aae7bf5 commit 1988e0d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

packages/google-cloud-monitoring/tests/unit/test_query.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
import datetime
1818
import unittest
19-
20-
import mock
19+
from unittest import mock
2120

2221
from google.cloud import monitoring_v3 as monitoring_v3
2322
from google.cloud.monitoring_v3 import MetricServiceClient

0 commit comments

Comments
 (0)