django-dynamic-fixture icon indicating copy to clipboard operation
django-dynamic-fixture copied to clipboard

Pass DDF models to pytest parametrize decorator

Open JakNowy opened this issue 2 years ago • 1 comments

It would be awesome if we could have something like:

@pytest.mark.parametrize('db_object', [G(Model1), G(Model2)])
    def test_foo(db_object):
        ...

Looks like there is some issue with the db init, would it be possible to make it work?

JakNowy avatar Jul 21 '22 13:07 JakNowy

Bumping. It can be worked around with some if statements (ideally switch case in new python), but still pollutes the code notably.

JakNowy avatar Nov 03 '23 11:11 JakNowy