-
Notifications
You must be signed in to change notification settings - Fork 42
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
Errors with factory_boy master: 'FactoryOptions' object has no attribute 'postgen_declarations' #47
Comments
Confirming that this has something to do with 2.9.0 (master) changes alone. I switched to FactoryBoy 2.8.1 and was able to avoid this issue for now. |
So far, ``factory-boy`` was not part of our explicit requirements because we relied on ``pytest-factoryboy`` to pull it as on of its dependencies. This however prooved error prone as recent ``factory-boy`` versions raise failures (at least in our context). In order to avoid this we move from installing ``factory-boy`` implicitly to making it part of our requirements as well as pin its last known functioning version. For details please also the [relevant ``pytest-factoryboy`` issue](pytest-dev/pytest-factoryboy#47)
So far, ``factory-boy`` was not part of our explicit requirements because we relied on ``pytest-factoryboy`` to pull it as on of its dependencies. This however prooved error prone as recent ``factory-boy`` versions raise failures (at least in our context). In order to avoid this we move from installing ``factory-boy`` implicitly to making it part of our requirements as well as pin its last known functioning version. For details please also the [relevant ``pytest-factoryboy`` issue](pytest-dev/pytest-factoryboy#47)
I also do report the same problems with 2.9.2 |
I would be happy to help with this but would prefer some feedback from the maintainers regarding their preferred way. My preference would be to go along with Let me know what you guys think. |
I decided to ditch pytest-factoryboy and simply write a function that injects the factories as fixtures as-is, per the example in pytest-dev/pytest#2424 So, if your current conftest.py looks like this:
try the following instead:
My current test suite works with it without modifications, and I no longer need pytest-factoryboy as the dependency. Your mileage may vary, so this may not be enough for your needs. |
Um Probleme in der Testausführung zu vermeiden legen wir eine explizite Verison für ``Factory-Boy`` fest so das ``pytest-factoryboy`` keine höhere (inkompatible) Version als Abhänigkeit installiert. Siehe dazu auch: pytest-dev/pytest-factoryboy#47
Please try 2.0.1 |
pytest-dev/pytest-factoryboy#47 was fixed in 2.0.1. Now it isn't needed (actually, it break its) to require old versions of factory boy
There are errors with
factory_boy
master: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).
The text was updated successfully, but these errors were encountered: