Skip to content Skip to sidebar Skip to footer
Showing posts with the label Monkeypatching

Dynamically Set An Instance Property / Memoized Attribute In Python?

I have an existing example class in Python 2.7x class Example(object): a = None b = None … Read more Dynamically Set An Instance Property / Memoized Attribute In Python?

Https Request Via Urllib2 Fails Behind Ntlm Proxy

Via Python's urllib2 I try to get data over HTTPS while I am behind a corporate NTLM proxy. I r… Read more Https Request Via Urllib2 Fails Behind Ntlm Proxy

How To Remove A Library With Monkeypatch Or Mock In Pytest?

If my library has a contrib extra that has dependencies in it (say requests) that I want users to h… Read more How To Remove A Library With Monkeypatch Or Mock In Pytest?

How To Dynamically Set An Object's Method At Runtime (when The Object Is An Instance Of A Gym Environment)?

I want to override an instance's method. Let's call this instance/object env. The instance … Read more How To Dynamically Set An Object's Method At Runtime (when The Object Is An Instance Of A Gym Environment)?

Monkeypatching Not Carrying Through Class Import

I'm trying to test some code using pytest and need to change a function from some module. One o… Read more Monkeypatching Not Carrying Through Class Import

Dynamically Set An Instance Property / Memoized Attribute In Python?

I have an existing example class in Python 2.7x class Example(object): a = None b = None … Read more Dynamically Set An Instance Property / Memoized Attribute In Python?

Monkeypatching Not Carrying Through Class Import

I'm trying to test some code using pytest and need to change a function from some module. One o… Read more Monkeypatching Not Carrying Through Class Import

How To Remove A Library With Monkeypatch Or Mock In Pytest?

If my library has a contrib extra that has dependencies in it (say requests) that I want users to h… Read more How To Remove A Library With Monkeypatch Or Mock In Pytest?