Skip to content

Commit 21a2f75

Browse files
author
ARF
committed
clean up temp files after running tests
1 parent 498c829 commit 21a2f75

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

shapefile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,9 +1190,14 @@ def __fieldNorm(self, fieldName):
11901190
def test(verbosity):
11911191
import doctest
11921192
doctest.NORMALIZE_WHITESPACE = 1
1193+
existing_files = set(os.listdir('.'))
11931194
if verbosity == 0:
11941195
print('Running doctests...')
11951196
failure_count, test_count = doctest.testfile("README.txt", verbose=verbosity)
1197+
temp_files = set(os.listdir('.')) - existing_files
1198+
for filename in temp_files:
1199+
if not os.path.isdir(filename):
1200+
os.unlink(filename)
11961201
if verbosity == 0 and failure_count == 0:
11971202
print('All test passed successfully')
11981203
return failure_count

0 commit comments

Comments
 (0)