Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/test_otiod.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def test_file_bundle_manifest(self):
self.assertEqual(len(manifest[fname]), count)

def test_round_trip(self):
tmp_path = tempfile.NamedTemporaryFile(suffix=".otiod").name
with tempfile.NamedTemporaryFile(suffix=".otiod") as bogusfile:
tmp_path = bogusfile.name
otio.adapters.write_to_file(self.tl, tmp_path)
self.assertTrue(os.path.exists(tmp_path))

Expand Down Expand Up @@ -132,7 +133,8 @@ def test_round_trip(self):
self.assertJsonEqual(result, self.tl)

def test_round_trip_all_missing_references(self):
tmp_path = tempfile.NamedTemporaryFile(suffix=".otiod").name
with tempfile.NamedTemporaryFile(suffix=".otiod") as bogusfile:
tmp_path = bogusfile.name
otio.adapters.write_to_file(
self.tl,
tmp_path,
Expand All @@ -154,7 +156,8 @@ def test_round_trip_all_missing_references(self):
)

def test_round_trip_absolute_paths(self):
tmp_path = tempfile.NamedTemporaryFile(suffix=".otiod").name
with tempfile.NamedTemporaryFile(suffix=".otiod") as bogusfile:
tmp_path = bogusfile.name
otio.adapters.write_to_file(self.tl, tmp_path)

# ...but can be optionally told to generate absolute paths
Expand Down
9 changes: 6 additions & 3 deletions tests/test_otioz.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def test_colliding_basename(self):
shutil.rmtree(tempdir)

def test_round_trip(self):
tmp_path = tempfile.NamedTemporaryFile(suffix=".otioz").name
with tempfile.NamedTemporaryFile(suffix=".otioz") as bogusfile:
tmp_path = bogusfile.name
otio.adapters.write_to_file(self.tl, tmp_path)
self.assertTrue(os.path.exists(tmp_path))

Expand Down Expand Up @@ -155,7 +156,8 @@ def test_round_trip(self):
self.assertJsonEqual(result, self.tl)

def test_round_trip_with_extraction(self):
tmp_path = tempfile.NamedTemporaryFile(suffix=".otioz").name
with tempfile.NamedTemporaryFile(suffix=".otioz") as bogusfile:
tmp_path = bogusfile.name
otio.adapters.write_to_file(self.tl, tmp_path)
self.assertTrue(os.path.exists(tmp_path))

Expand Down Expand Up @@ -213,7 +215,8 @@ def test_round_trip_with_extraction(self):
)

def test_round_trip_with_extraction_no_media(self):
tmp_path = tempfile.NamedTemporaryFile(suffix=".otioz").name
with tempfile.NamedTemporaryFile(suffix=".otioz") as bogusfile:
tmp_path = bogusfile.name
otio.adapters.write_to_file(
self.tl,
tmp_path,
Expand Down