Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RelatedFactory is not working inside fixtures #97

Open
aimestereo opened this issue Oct 6, 2020 · 0 comments
Open

RelatedFactory is not working inside fixtures #97

aimestereo opened this issue Oct 6, 2020 · 0 comments

Comments

@aimestereo
Copy link

aimestereo commented Oct 6, 2020

How to reproduce (just one step):

to test https://github.com/pytest-dev/pytest-factoryboy/blob/master/tests/test_circular.py

add

@pytest.fixture(autouse=True)
def autouse_fixture_check(author):
    assert author.books

Output:

E
test setup failed
author = <test.Author object at 0x10a426dd0>

    @pytest.fixture(autouse=True)
    def autouse_fixture_check(author):
>       assert author.books
E       assert []
E        +  where [] = <test.Author object at 0x10a426dd0>.books

test.py:53: AssertionError

Broken versions: >= 2.0.1, <= 2.0.3 (current)
Last version that works: 1.3.2

Example setup for working version:

pip install pytest==3.10.1 factory-boy==2.8.1 pytest-factoryboy==1.3.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant