Monkeypatching

Latest version: v0.2.0

Safety actively analyzes 624735 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.2.0

What's Changed
* Edit globals during a function call by heetbeet in https://github.com/AutoActuary/monkeypatching/pull/1

New Contributors
* heetbeet made their first contribution in https://github.com/AutoActuary/monkeypatching/pull/1

**Full Changelog**: https://github.com/AutoActuary/monkeypatching/compare/0.1.0...0.2.0

0.1.0

Quick Example

python
from monkeypatching import monkeypatch_module_object, monkeypatch_setattr
import json

Temporary attribute replacement
with monkeypatch_setattr(json, "loads", lambda x: {"mocked": True}):
pass

Recursive object replacement
with monkeypatch_module_object(json, json.dumps, lambda x, *args, **kwargs: "{}"):
pass


**Read the [full documentation](URL) for more details.**

Thank You

Initial release. Your feedback is invaluable; please try it out and let us know what you think.

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.