Skip to content

Commit 98d9f95

Browse files
Use context managers for tests/test_schema.py
1 parent 66e0d7e commit 98d9f95

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_schema.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,9 @@ def test_jsonpatch_fail(patch):
575575

576576
@pytest.mark.parametrize('patchset_file', ['patchset_good.json'])
577577
def test_patchset(datadir, patchset_file):
578-
with open(datadir.joinpath(patchset_file), encoding="utf-8") as patch_file:
579-
patchset = json.load(patch_file)
580-
pyhf.schema.validate(patchset, 'patchset.json')
578+
with open(datadir.joinpath(patchset_file), encoding="utf-8") as read_file:
579+
patchset = json.load(read_file)
580+
pyhf.schema.validate(patchset, "patchset.json")
581581

582582

583583
@pytest.mark.parametrize(
@@ -596,10 +596,10 @@ def test_patchset(datadir, patchset_file):
596596
],
597597
)
598598
def test_patchset_fail(datadir, patchset_file):
599-
with open(datadir.joinpath(patchset_file), encoding="utf-8") as patch_file:
600-
patchset = json.load(patch_file)
599+
with open(datadir.joinpath(patchset_file), encoding="utf-8") as read_file:
600+
patchset = json.load(read_file)
601601
with pytest.raises(pyhf.exceptions.InvalidSpecification):
602-
pyhf.schema.validate(patchset, 'patchset.json')
602+
pyhf.schema.validate(patchset, "patchset.json")
603603

604604

605605
def test_defs_always_cached(

0 commit comments

Comments
 (0)