Skip to content

Commit

Permalink
test: modify unit test case for apply (#4052)
Browse files Browse the repository at this point in the history
  • Loading branch information
makram93 committed Dec 10, 2021
1 parent b0f77f4 commit f2d2ae4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/unit/types/arrays/mixins/test_parallel.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os

import pytest

from jina import DocumentArray, Document, DocumentArrayMemmap
from jina import DocumentArray, Document, DocumentArrayMemmap, Executor, requests


def foo(d: Document):
Expand Down Expand Up @@ -98,14 +97,11 @@ def test_map_lambda(pytestconfig, da_cls):
assert d.blob is not None


@pytest.mark.skipif(
'GITHUB_WORKFLOW' in os.environ,
reason='this test somehow fail on Github CI, but it MUST run successfully on local',
)
@pytest.mark.parametrize('da_cls', [DocumentArray, DocumentArrayMemmap])
def test_map_nested(da_cls):
class Executor:
def foo(self, docs: DocumentArray):
class NestedExecutor(Executor):
@requests
def foo(self, docs: DocumentArray, **kwargs):
def bar(d: Document):
d.text = 'hello'
return d
Expand All @@ -115,6 +111,6 @@ def bar(d: Document):

N = 2
da = DocumentArray.empty(N)
exec = Executor()
exec = NestedExecutor()
da1 = exec.foo(da)
assert da1.texts == ['hello'] * N

0 comments on commit f2d2ae4

Please sign in to comment.