Skip to content

Commit c466f23

Browse files
committed
Merge branch 'enh/report-bokeh' of github.com:me-pic/phys2bids into enh/report-bokeh
2 parents 6a3acce + eba5a34 commit c466f23

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

phys2bids/tests/conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import os
22
import ssl
3-
from urllib.request import urlretrieve
43

54
import pytest
5+
import requests
66

77

88
def pytest_addoption(parser):
@@ -50,7 +50,11 @@ def fetch_file(osf_id, path, filename):
5050
url = "https://osf.io/{}/download".format(osf_id)
5151
full_path = os.path.join(path, filename)
5252
if not os.path.isfile(full_path):
53-
urlretrieve(url, full_path)
53+
req = requests.get(url, allow_redirects=True)
54+
req.raise_for_status()
55+
with open(full_path, "wb") as f:
56+
f.write(req.content)
57+
f.close()
5458
return full_path
5559

5660

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ test =
6464
pytest >=5.3
6565
pytest-cov
6666
coverage
67+
requests
6768
%(interfaces)s
6869
%(reports)s
6970
%(style)s

0 commit comments

Comments
 (0)