Category "monkeypatching"

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