-
Hello, I would like to use My case is a raw list with a dictionary and a generated dataclass list. What I want to achieve is comparing the raw list against the dataclass generated list. The dataclass is represented below:
As an example, I used the following
So now, I do the following test in "test_filling.py":
I ended-up with the following error: How can I fix this ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
According to the documentation
import pytest
from pytest_lazyfixture import lazy_fixture
@pytest.fixture
def one():
return 1
@pytest.mark.parametrize('arg1,arg2', [
('val1', lazy_fixture('one')),
])
def test_func(arg1, arg2):
assert arg2 == 1 See also: TvoroG/pytest-lazy-fixture#56 |
Beta Was this translation helpful? Give feedback.
-
I guess it should look something like this: @pytest.mark.parametrize("generated, raw", [
(
pytest.lazy_fixture("fixture_generated"),
pytest.lazy_fixture("fixture_raw")),
)
])
def test_compare_id(generated, raw):
... |
Beta Was this translation helpful? Give feedback.
TvoroG/pytest-lazy-fixture#65