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

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?

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

Testing Asyncio With Pytest: How To Test A Try-except Block By Mocking The Event Loop?

In a source code (source link here and WIP PR here) I am working with, I am trying to improve test … Read more Testing Asyncio With Pytest: How To Test A Try-except Block By Mocking The Event Loop?

Really Weird... Can't Set Attributes Of Built-in/extension Type 'lxml.etree._element'

I've changed attributes for other classes before without issues. _Element is obviously not a bu… Read more Really Weird... Can't Set Attributes Of Built-in/extension Type 'lxml.etree._element'