Skip to content

Instantly share code, notes, and snippets.

@Pigueiras
Pigueiras / gist:0687f2500136b63d739b2cb272bf3ce0
Last active May 22, 2018
How to mock imports in python?
View gist:0687f2500136b63d739b2cb272bf3ce0
/tmp/wow
15:12 $ cat a.py
import requests
def my_fn():
return requests.get("not")
/tmp/wow
15:13 $ cat test.py
import pytest
import mock