Category "monkeypatching"

How to patch local function of a variable?

I tried to write a test for this but I keep getting an error that the list is not callable. How can I patch nodes.items() so that items returns a list? # Get li

Mock Dependency classes in FastAPI

I have an api which is representative of the structure of: from fastapi import FastAPI, Depends, Request, APIRouter class SomeManager: def get_value_from

How to patch input() when testing Jupyter notebook cells with testbook?

A project I'm involved in uses testbook to test code cells of Jupyter notebooks. Patching works fine — unless the code to be tested asks for