Fixes up some minor warnings from test code

This commit is contained in:
Trenton Holmes
2023-02-05 17:42:35 -08:00
committed by Trenton H
parent 7bfb11a711
commit 3e777f2a5b
4 changed files with 20 additions and 20 deletions

View File

@@ -342,6 +342,7 @@ class Consumer(LoggingMixin):
mime_type,
)
if not parser_class:
tempdir.cleanup()
self._fail(MESSAGE_UNSUPPORTED_TYPE, f"Unsupported mime type {mime_type}")
# Notify all listeners that we're going to do some work.
@@ -400,6 +401,7 @@ class Consumer(LoggingMixin):
except ParseError as e:
document_parser.cleanup()
tempdir.cleanup()
self._fail(
str(e),
f"Error while consuming document {self.filename}: {e}",