Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit608147e

Browse files
committed
Better explain conditional cleanup in test_base_object
This expands the comment added in41fac85 (#1770) to make moreclear that this particular cleanup is deliberately done only whenthe operation was successful (and why).
1 parent018ebaf commit608147e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎test/test_base.py

Lines changed: 4 additions & 1 deletion
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)

[8]ページ先頭

©2009-2025 Movatter.jp