requests-mock provides a building block to stub out the HTTP requests portions of your testing code.
conda install anaconda-python-gte-3.10::requests-mock