@@ -237,7 +237,7 @@ def test_unit_is_pdf_valid_pdf():
237237 assert result is True
238238
239239
240- def test_unit_is_pdf_valid_pdf_without_file_extension (caplog ):
240+ def test_unit_is_pdf_valid_pdf_without_file_extension ():
241241 """Test is pdf method returns True for file with valid pdf content without basing on file extension."""
242242 filename = "_sample_docs/layout-parser-paper-fast.pdf"
243243
@@ -252,36 +252,31 @@ def test_unit_is_pdf_valid_pdf_without_file_extension(caplog):
252252 assert result is True
253253
254254
255- def test_unit_is_pdf_invalid_extension (caplog ):
255+ def test_unit_is_pdf_invalid_extension ():
256256 """Test is pdf method returns False for file with invalid extension."""
257257 file = shared .Files (content = b"txt_content" , file_name = "test_file.txt" )
258258
259- with caplog .at_level (logging .WARNING ):
260- result = pdf_utils .is_pdf (file )
259+ result = pdf_utils .is_pdf (file )
261260
262261 assert result is False
263- assert "The file does not appear to be a valid PDF." in caplog .text
264262
265263
266- def test_unit_is_pdf_invalid_pdf (caplog ):
264+ def test_unit_is_pdf_invalid_pdf ():
267265 """Test is pdf method returns False for file with invalid pdf content."""
268266 file = shared .Files (content = b"invalid_pdf_content" , file_name = "test_file.pdf" )
269267
270- with caplog .at_level (logging .WARNING ):
271- result = pdf_utils .is_pdf (file )
268+ result = pdf_utils .is_pdf (file )
272269
273270 assert result is False
274- assert "The file does not appear to be a valid PDF." in caplog .text
275271
276- def test_unit_is_pdf_invalid_pdf_without_file_extension (caplog ):
272+
273+ def test_unit_is_pdf_invalid_pdf_without_file_extension ():
277274 """Test is pdf method returns False for file with invalid pdf content without basing on file extension."""
278275 file = shared .Files (content = b"invalid_pdf_content" , file_name = "uuid1234" )
279276
280- with caplog .at_level (logging .WARNING ):
281- result = pdf_utils .is_pdf (file )
277+ result = pdf_utils .is_pdf (file )
282278
283279 assert result is False
284- assert "The file does not appear to be a valid PDF." in caplog .text
285280
286281
287282def test_unit_get_starting_page_number_missing_key ():
0 commit comments