Skip to content

Commit b694332

Browse files
committed
RF: use tmpdir not tmp_path fixture
For compatibility with older pytest (e.g. 3.6.4 e.g. on ubuntu 18.04) Fixes #400
1 parent b774a08 commit b694332

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

heudiconv/tests/test_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ def test_json_dumps_pretty():
6767
assert pretty({'WipMemBlock': tstr}) == '{\n "WipMemBlock": "%s"\n}' % tstr
6868

6969

70-
def test_load_json(tmp_path, caplog):
70+
def test_load_json(tmpdir, caplog):
7171
# test invalid json
7272
ifname = 'invalid.json'
73-
invalid_json_file = str(tmp_path / ifname)
74-
create_tree(str(tmp_path), {ifname: u"I'm Jason Bourne"})
73+
invalid_json_file = str(tmpdir / ifname)
74+
create_tree(str(tmpdir), {ifname: u"I'm Jason Bourne"})
7575

7676
with pytest.raises(JSONDecodeError):
7777
load_json(str(invalid_json_file))
@@ -81,7 +81,7 @@ def test_load_json(tmp_path, caplog):
8181
# test valid json
8282
vcontent = {"secret": "spy"}
8383
vfname = "valid.json"
84-
valid_json_file = str(tmp_path / vfname)
84+
valid_json_file = str(tmpdir / vfname)
8585
save_json(valid_json_file, vcontent)
8686

8787
assert load_json(valid_json_file) == vcontent

0 commit comments

Comments
 (0)