Skip to content

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

@rominf

Description

@rominf

imports mock from https://pypi.org/project/mock/ library directly.

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.

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

The solution is to reuse approach in auto-generated code:

try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER
except ImportError: # pragma: NO COVER
import mock

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions