Skip to content

Document dangers of monkeypatching/mocking stdlib #11022

@nicoddemus

Description

@nicoddemus

We could add a warning + document recommended/possible patterns.

A possible pattern is instead of patching the stdlib, replacing the imported references with patched objects (with all the minefield style fragility that comes of it).

The other pattern would be to add testability instrumentation into libraries, and then one can pass the dependencies instead of breaking

Originally posted by @RonnyPfannschmidt in #11018 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: docsdocumentation improvement, missing or needing clarification

    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