Skip to content

mypy complains about monkey-patching classes in another module #1152

Closed as not planned
@timabbott

Description

@timabbott

This issue affects unannotated code. Here's some example code from https://github.com/zulip/zulip/blob/master/zerver/lib/test_helpers.py#L47:

@contextmanager
def simulated_queue_client(client):
    real_SimpleQueueClient = queue_processors.SimpleQueueClient
    queue_processors.SimpleQueueClient = client
    yield
    queue_processors.SimpleQueueClient = real_SimpleQueueClient

(There's a similar issue with replacing a function rather than a class; and an example a few lines down in the Zulip codebase)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions