def test_download_file(tmpdir):
with requests_mock.mock() as m:
m.get(requests_mock.ANY, text="")
path = os.path.join(tmpdir, "somefilepath")
utils.download_file("https://someurl", path)
assert os.path.exists(path)
After Change
with requests_mock.mock() as m:
m.get(requests_mock.ANY, text="")
// convert to string to make python<3.6 happy
path = str(tmpdir.join("somefilepath"))
utils.download_file("https://someurl", path)
assert os.path.exists(path)