Skip to content

TypeError: 'LazyFixture' object is not iterable #56

@ChristianF88

Description

@ChristianF88

Hi there,

I am running into issues with using a fixture, that loads a list of parameters that I want to use to parametrize tests. I am not sure, whether that is something, that can be done with your package and I just can't figure it out, or whether that would be a new feature.

Here is a example on what I want to achieve:

import pytest

@pytest.fixture()
def one(tmp_path):
    return list(str(tmp_path))

@pytest.mark.parametrize("char", pytest.lazy_fixture('one'))
def test_func(char):
    assert char.isascii()

Do you have an idea on how to get my code running?

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions