Skip to content

Commit 608147e

Browse files
committed
Better explain conditional cleanup in test_base_object
This expands the comment added in 41fac85 (gitpython-developers#1770) to make more clear that this particular cleanup is deliberately done only when the operation was successful (and why).
1 parent 018ebaf commit 608147e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: test/test_base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ def test_base_object(self):
7272
self.assertEqual(item, item.stream_data(tmpfile))
7373
tmpfile.seek(0)
7474
self.assertEqual(tmpfile.read(), data)
75-
os.remove(tmpfile.name) # Do it this way so we can inspect the file on failure.
75+
76+
# Remove the file this way, instead of with a context manager or "finally",
77+
# so it is only removed on success, and we can inspect the file on failure.
78+
os.remove(tmpfile.name)
7679
# END for each object type to create
7780

7881
# Each has a unique sha.

0 commit comments

Comments
 (0)