Skip to content

Commit 77b1755

Browse files
committed
WIP - try closing at exit
1 parent 7871b01 commit 77b1755

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: examples/python/tests/troubleshooting/test_logging.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import atexit
12
import logging
23
import os
34

@@ -24,4 +25,6 @@ def test_logging():
2425
with open(log_path, 'r') as fp:
2526
assert len(fp.readlines()) == 3
2627
finally:
27-
os.remove(log_path)
28+
atexit.register(delete_path, log_path)
29+
def delete_path(path):
30+
os.remove(path)

0 commit comments

Comments
 (0)