Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test
Browse files Browse the repository at this point in the history
IlyaFaer committed Jul 31, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 37647ef commit cdd7a9d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/pipeline/test_pipeline_extra.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
import importlib.util
from typing import Any, ClassVar, Dict, Iterator, List, Optional
import pytest
from unittest import mock

try:
from pydantic import BaseModel
@@ -99,6 +100,20 @@ def test_pipeline_progress(progress: TCollectorArg) -> None:
assert isinstance(collector, LogCollector)


@pytest.mark.parametrize("progress", ["tqdm", "enlighten", "log", "alive_progress"])
def test_pipeline_normalize_progress(progress: TCollectorArg) -> None:
os.environ["TIMEOUT"] = "3.0"

p = dlt.pipeline(destination="dummy", progress=progress)
p.extract(many_delayed(5, 10))

with mock.patch.object(p.collector, "update") as col_mock:
p.normalize(extracted_count=10)
assert col_mock.call_count == 54

p.run(dataset_name="dummy")


@pytest.mark.parametrize("method", ("extract", "run"))
def test_column_argument_pydantic(method: str) -> None:
"""Test columns schema is created from pydantic model"""

0 comments on commit cdd7a9d

Please sign in to comment.