Chore: Make linter happy (#1256)

* refactor: remove unused imports

* fix: replace NotImplemented with NotImplementedError

* refactor: resolve E722 (do not use bare 'except')

* refactor: remove unused variable

* refactor: remove unused imports

* refactor: ignore unused imports that will be used in the future

* refactor: resolve W293 (blank line contains whitespace)

* refactor: resolve F541 (f-string is missing placeholders)

---------

Co-authored-by: afourney <adamfo@microsoft.com>
This commit is contained in:
t3tra
2025-05-22 02:02:16 +09:00
committed by GitHub
parent 39e7252940
commit cb421cf9ea
26 changed files with 25 additions and 69 deletions

View File

@@ -1,6 +1,5 @@
#!/usr/bin/env python3 -m pytest
import subprocess
import pytest
from markitdown import __version__
# This file contains CLI tests that are not directly tested by the FileTestVectors.
@@ -24,8 +23,8 @@ def test_invalid_flag() -> None:
assert result.returncode != 0, f"CLI exited with error: {result.stderr}"
assert (
"unrecognized arguments" in result.stderr
), f"Expected 'unrecognized arguments' to appear in STDERR"
assert "SYNTAX" in result.stderr, f"Expected 'SYNTAX' to appear in STDERR"
), "Expected 'unrecognized arguments' to appear in STDERR"
assert "SYNTAX" in result.stderr, "Expected 'SYNTAX' to appear in STDERR"
if __name__ == "__main__":

View File

@@ -19,13 +19,6 @@ else:
FileTestVector,
)
from markitdown import (
MarkItDown,
UnsupportedFormatException,
FileConversionException,
StreamInfo,
)
skip_remote = (
True if os.environ.get("GITHUB_ACTIONS") else False
) # Don't run these tests in CI
@@ -140,8 +133,6 @@ def test_convert_url(shared_tmp_dir, test_vector):
"""Test the conversion of a stream with no stream info."""
# Note: tmp_dir is not used here, but is needed to match the signature
markitdown = MarkItDown()
time.sleep(1) # Ensure we don't hit rate limits
result = subprocess.run(
["python", "-m", "markitdown", TEST_FILES_URL + "/" + test_vector.filename],
@@ -191,7 +182,6 @@ def test_output_to_file_with_data_uris(shared_tmp_dir, test_vector) -> None:
if __name__ == "__main__":
import sys
import tempfile
"""Runs this file's tests from the command line."""

View File

@@ -3,7 +3,6 @@ import io
import os
import re
import shutil
import openai
import pytest
from markitdown._uri_utils import parse_data_uri, file_uri_to_path
@@ -253,8 +252,6 @@ def test_file_uris() -> None:
def test_docx_comments() -> None:
markitdown = MarkItDown()
# Test DOCX processing, with comments and setting style_map on init
markitdown_with_style_map = MarkItDown(style_map="comment-reference => ")
result = markitdown_with_style_map.convert(

View File

@@ -2,7 +2,6 @@
import os
import time
import pytest
import codecs
import base64
from pathlib import Path
@@ -14,8 +13,6 @@ else:
from markitdown import (
MarkItDown,
UnsupportedFormatException,
FileConversionException,
StreamInfo,
)
@@ -203,8 +200,6 @@ def test_convert_stream_keep_data_uris(test_vector):
if __name__ == "__main__":
import sys
"""Runs this file's tests from the command line."""
# General tests