Closed dburton90 closed 6 years ago
Hi, @dburton90! Thanks for the example and finding a bug. There was a problem with incorrect order of fixture initialization. I fixed it in issues19 branch. Can you please test it on your project and give some feedback if it works for you?
Hi thanks for changes the old test passed. But I found new test, where the error occurs again:
E TypeError: unsupported operand type(s) for +: 'int' and 'LazyFixture'
If I use pytest_fixture_setup hook it works. But I am actually not sure if this behaviour is supported by pytest or if this is just side-efect.
Hi! Sorry for the late response :) I'll check it. Maybe there is a better solution for this problem.
But I am actually not sure if this behaviour is supported by pytest or if this is just side-efect.
Yeah, me too :)
Anyway, I merged my changes to master and shipped it to pypi. For now I'll close it. Feel free to reopen if there will be more problems with the plugin :)
Hi, you asked me about some example for the issue I tried to resolve by the pull request from yestrday. So I added test to test_lazyfixture.py. It is basicly about indirect lazy_fixtures in test generator, which can do some modificition (in examle it is list modificition, but in real life it is usualy some db modificition etc...). If you run tests, the new test will fail on TypeError: 'LazyFixture' object does not support indexing. Beacause LazyFixture is never inicialized. If you uncommented lines 15-24 in pytest_lazyfixture.py, the test will pass.