moved parameter combination based test skipping into operation factory
This commit is contained in:
parent
13888524fb
commit
54ca81d577
5
test/fixtures/server.py
vendored
5
test/fixtures/server.py
vendored
@ -1,4 +1,5 @@
|
||||
import io
|
||||
import logging
|
||||
import socket
|
||||
from itertools import repeat
|
||||
from multiprocessing import Process
|
||||
@ -19,6 +20,8 @@ from pyinfra.server.utils import make_streamable_and_wrap_in_packing_logic
|
||||
from pyinfra.utils.func import starlift
|
||||
from test.utils.image import image_to_bytes
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def host():
|
||||
@ -105,6 +108,8 @@ def core_operation(item_type, one_to_many, analysis_task):
|
||||
}
|
||||
return d[one_to_many][item_type][analysis_task]
|
||||
except KeyError:
|
||||
pytest.skip(f"No operation defined for parameter combination.")
|
||||
logger.debug(f"No operation defined for [{one_to_many=}, {item_type=}, {analysis_task=}].")
|
||||
return Nothing
|
||||
|
||||
|
||||
|
||||
@ -29,11 +29,8 @@ def test_mock_pipeline():
|
||||
|
||||
|
||||
@pytest.mark.parametrize("client_pipeline_type", ["rest", "basic"])
|
||||
def test_pipeline(
|
||||
core_operation, client_pipeline, input_data_items, metadata, targets, item_type, one_to_many, n_items
|
||||
):
|
||||
if core_operation is Nothing:
|
||||
pytest.skip(f"No operation defined for parameter combination: {item_type=}, {one_to_many=}")
|
||||
def test_pipeline(core_operation, client_pipeline, input_data_items, metadata, targets, n_items):
|
||||
assert core_operation is not Nothing
|
||||
output = compose(llift(unpack), client_pipeline)(input_data_items, metadata)
|
||||
assert n_items == 0 or len(output) > 0
|
||||
assert output == targets
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user