Skip to content

Errors with factory_boy master: 'FactoryOptions' object has no attribute 'postgen_declarations' #47

@blueyed

Description

@blueyed

There are errors with factory_boy master:

================================================ ERRORS ================================================
_______________________________ ERROR collecting tests/test_circular.py ________________________________
tests/test_circular.py:50: in <module>
    register(AuthorFactory)
.tox/py36-pytest3/lib/python3.6/site-packages/pytest_factoryboy/fixture.py:60: in register
    deps = get_deps(factory_class, model_name=model_name)
.tox/py36-pytest3/lib/python3.6/site-packages/pytest_factoryboy/fixture.py:154: in get_deps
    for attr, value in factory_class.declarations(factory_class._meta.postgen_declarations).items()
E   AttributeError: 'FactoryOptions' object has no attribute 'postgen_declarations'
___________________________ ERROR collecting tests/test_factory_fixtures.py ____________________________
tests/test_factory_fixtures.py:56: in <module>
    class AuthorFactory(factory.Factory):
.tox/py36-pytest3/lib/python3.6/site-packages/pytest_factoryboy/fixture.py:60: in register
    deps = get_deps(factory_class, model_name=model_name)
.tox/py36-pytest3/lib/python3.6/site-packages/pytest_factoryboy/fixture.py:154: in get_deps
    for attr, value in factory_class.declarations(factory_class._meta.postgen_declarations).items()
E   AttributeError: 'FactoryOptions' object has no attribute 'postgen_declarations'
_____________________________ ERROR collecting tests/test_lazy_fixture.py ______________________________
tests/test_lazy_fixture.py:29: in <module>
    register(UserFactory)
.tox/py36-pytest3/lib/python3.6/site-packages/pytest_factoryboy/fixture.py:60: in register
    deps = get_deps(factory_class, model_name=model_name)
.tox/py36-pytest3/lib/python3.6/site-packages/pytest_factoryboy/fixture.py:154: in get_deps
    for attr, value in factory_class.declarations(factory_class._meta.postgen_declarations).items()
E   AttributeError: 'FactoryOptions' object has no attribute 'postgen_declarations'
_________________________ ERROR collecting tests/test_postgen_dependencies.py __________________________
tests/test_postgen_dependencies.py:23: in <module>
    class FooFactory(factory.Factory):
.tox/py36-pytest3/lib/python3.6/site-packages/pytest_factoryboy/fixture.py:60: in register
    deps = get_deps(factory_class, model_name=model_name)
.tox/py36-pytest3/lib/python3.6/site-packages/pytest_factoryboy/fixture.py:154: in get_deps
    for attr, value in factory_class.declarations(factory_class._meta.postgen_declarations).items()
E   AttributeError: 'FactoryOptions' object has no attribute 'postgen_declarations'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================= 4 error in 0.30 seconds ========================================
ERROR: InvocationError: '…/Vcs/pytest-factoryboy/.tox/py36-pytest3/bin/py.test --junitxml=…/Vcs/pytest-factoryboy/.tox/py36-pytest3/log/junit-py36-pytest3.xml pytest_factoryboy tests'
_______________________________________________ summary ________________________________________________
ERROR:   py36-pytest3: commands failed

Bisecting brings up the following commits (2 are skipped, since they cause a different error):

FactoryBoy/factory_boy@c079d87
FactoryBoy/factory_boy@e447662
FactoryBoy/factory_boy@6f20207

Likely related to the refactoring mentioned in #23 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions