Skip to content

Commit 29949ae

Browse files
committed
Close the tempfile for PyPy+Windows.
Otherwise there's no guarantee it's closed by the time we try to os.remove, and Windows doesn't like that very much.
1 parent f241ee5 commit 29949ae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

jsonschema/tests/test_cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ def test_successful_validation_of_just_the_schema_pretty_output(self):
697697

698698
def test_successful_validation_via_explicit_base_uri(self):
699699
ref_schema_file = tempfile.NamedTemporaryFile(delete=False)
700+
ref_schema_file.close()
700701
self.addCleanup(os.remove, ref_schema_file.name)
701702

702703
ref_path = Path(ref_schema_file.name)
@@ -717,6 +718,7 @@ def test_successful_validation_via_explicit_base_uri(self):
717718

718719
def test_unsuccessful_validation_via_explicit_base_uri(self):
719720
ref_schema_file = tempfile.NamedTemporaryFile(delete=False)
721+
ref_schema_file.close()
720722
self.addCleanup(os.remove, ref_schema_file.name)
721723

722724
ref_path = Path(ref_schema_file.name)

0 commit comments

Comments
 (0)