-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add: sync convert to parsers * add: tests
- Loading branch information
Showing
11 changed files
with
193 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import pytest | ||
from megaparse import MegaParse | ||
from megaparse.parser.doctr_parser import DoctrParser | ||
from megaparse.parser.llama import LlamaParser | ||
from megaparse.parser.megaparse_vision import MegaParseVision | ||
from megaparse.parser.unstructured_parser import UnstructuredParser | ||
|
||
PARSER_LIST = [ | ||
UnstructuredParser, | ||
DoctrParser, | ||
] # LlamaParser, MegaParseVision are long and costly to test | ||
|
||
|
||
@pytest.mark.parametrize("parser", PARSER_LIST) | ||
def test_sync_parsers(parser): | ||
parser = parser() | ||
megaparse = MegaParse(parser) | ||
response = megaparse.load("./tests/data/dummy.pdf") | ||
print(response) | ||
assert response | ||
assert len(response) > 0 | ||
|
||
|
||
@pytest.mark.asyncio | ||
@pytest.mark.parametrize("parser", PARSER_LIST) | ||
async def test_async_parsers(parser): | ||
parser = parser() | ||
megaparse = MegaParse(parser) | ||
response = await megaparse.aload("./tests/data/dummy.pdf") | ||
print(response) | ||
assert len(response) > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters