Skip to content

Commit

Permalink
Mark tests for asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
sultaniman committed May 7, 2024
1 parent 514c5a7 commit 33b5af6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/pipeline/test_resources_evaluation.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
from typing import Any, List
import asyncio
import os
import time
import threading
import random
from itertools import product

import dlt, asyncio, pytest, os
import dlt
import pytest

from dlt.extract.exceptions import ResourceExtractionError


@pytest.mark.asyncio
def test_async_iterator_resource() -> None:
# define an asynchronous iterator
@dlt.resource()
Expand Down Expand Up @@ -41,6 +45,7 @@ async def __anext__(self):
#
# async generators resource tests
#
@pytest.mark.asyncio
def test_async_generator_resource() -> None:
async def async_gen_table():
for l_ in ["a", "b", "c"]:
Expand Down Expand Up @@ -70,6 +75,7 @@ async def async_gen_resource():
assert [r[0] for r in rows] == ["a", "b", "c", "d", "e", "f"]


@pytest.mark.asyncio
def test_async_generator_nested() -> None:
def async_inner_table():
async def _gen(idx):
Expand Down Expand Up @@ -124,6 +130,7 @@ async def async_transformer(item):
assert {r[0] for r in rows} == {"at", "bt", "ct"}


@pytest.mark.asyncio
@pytest.mark.parametrize("next_item_mode", ["fifo", "round_robin"])
@pytest.mark.parametrize(
"resource_mode", ["both_sync", "both_async", "first_async", "second_async"]
Expand Down

0 comments on commit 33b5af6

Please sign in to comment.