An interesting read about testing code using nullable states instead of mocks.
https://www.jamesshore.com/v2/projects/testing-without-mocks/testing-without-mocks
@prologic@twtxt.net I did something similar with a external module for my work project (in python), extending a class that does nothing and implementing what you need for each “extension”.
Basically I’m relying on a Polymorphic class to do it.