Using a fake mongoDB for pytest testing
问题 I have code that connects to a MongoDB Client and I'm trying to test it. For testing, I don't want to connect to the actual client, so I'm trying to figure out make a fake one for testing purposes. The basic flow of the code is I have a function somewhere the creates a pymongo client, then queries that and makes a dict that is used elsewhere. I want to write some tests using pytest that will test different functions and classes that will call get_stuff . My problem is that get_stuff calls