format via black

This commit is contained in:
Raduan77 2024-12-18 10:45:05 +01:00
parent 60d2840656
commit 314c0dced8
3 changed files with 10 additions and 13 deletions

View file

@ -46,6 +46,7 @@ dependencies = [
dev-dependencies = [ dev-dependencies = [
"pytest>=7.0", "pytest>=7.0",
"pytest-asyncio>=0.23.0", "pytest-asyncio>=0.23.0",
"black>=23.7.0",
] ]
[project.urls] [project.urls]

View file

@ -1,10 +1,12 @@
"""Async wrapper for MarkItDown.""" """Async wrapper for MarkItDown."""
import asyncio import asyncio
from functools import partial from functools import partial
from typing import Optional, Union from typing import Optional, Union
from ._markitdown import MarkItDown, DocumentConverterResult from ._markitdown import MarkItDown, DocumentConverterResult
class AsyncMarkItDown: class AsyncMarkItDown:
"""Async wrapper for MarkItDown that runs operations in a thread pool.""" """Async wrapper for MarkItDown that runs operations in a thread pool."""

View file

@ -207,15 +207,9 @@ async def test_async_markitdown_concurrent():
# Create a list of tasks # Create a list of tasks
tasks = [] tasks = []
for _ in range(5): for _ in range(5):
tasks.append( tasks.append(markitdown.convert(os.path.join(TEST_FILES_DIR, "test.docx")))
markitdown.convert(os.path.join(TEST_FILES_DIR, "test.docx")) tasks.append(markitdown.convert(os.path.join(TEST_FILES_DIR, "test.xlsx")))
) tasks.append(markitdown.convert(os.path.join(TEST_FILES_DIR, "test.pptx")))
tasks.append(
markitdown.convert(os.path.join(TEST_FILES_DIR, "test.xlsx"))
)
tasks.append(
markitdown.convert(os.path.join(TEST_FILES_DIR, "test.pptx"))
)
# Run all tasks concurrently # Run all tasks concurrently
results = await asyncio.gather(*tasks) results = await asyncio.gather(*tasks)