Skip to content

Objects not supported in @matrix annotation #384

@kc596

Description

@kc596

@confluentinc/quality-eng is tagged for visibility

Describe the bug
@matrix annotation is working only if list of primitives are used and not if list of objects are used.

To Reproduce
You can use following example to reproduce :

@dataclass
class Car:
    x: int
    y: int

@dataclass
class Bus:
    x: int
    y: int


# Declare global var of list of objects :
CARS = [Car(1,2)]
BUSES = [Bus(1,2), Bus(2,3)]

# Following annotation works :
@matrix(car_index=[0], bus_index=[0,1])
def test(self, car_index: int, bus_index: int):
    car = CARS[car_index]
    bus = BUSES[bus_index]

# However, this one is not working :
@matrix(car=CARS, bus=BUSES)
def test(self, car: Car, bus: Bus):
    pass

Expected behavior
The tests should work even when list of objects are passed into @matrix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions