0

I'm trying pytest_cases, and I came across the following, for one variable, only one value can be returned within the framework of the case. Code:

from pytest_cases import case, parametrize_with_cases
import pytest

class CaseClass:

    def case_get_values(self):
        request_values = [2, 5, 20, 4]
        return request_values


class TestBase:
    @parametrize_with_cases('values_request', cases=CaseClass)
    def test_a(self, values_request):
        assert values_request < 15`

Is it possible to make it swallow multiple values for one variable (a list of values)? Actually, in variable "request_values" will be the result of the response to the http request, and it can return a different number of values

In the class "CaseClass", I made a breakdown into several cases, each case for its own value, but, of course, this does not fit, since I wrote above, the number of values may vary, and each value has its "case", it does not look convenient

Hai Vu
  • 37,849
  • 11
  • 66
  • 93

0 Answers0