Hi Vasily! On Fri, Mar 16, 2018 at 7:17 AM Vasily Kuznetsov <kvas...@gmail.com> wrote:
> I very much agree with Floris that if you need fixture A to run before > fixture B and otherwise things break, this is called "dependency" and it's > better if it's explicitly declared. > Definitely, if a fixture requires something that is done by another fixture, then that dependency should be explicitly defined; but the issue is more that people expect higher level scoped fixtures to be executed first, and when you mix autouse fixtures and usefixtures markers, the order is non-intuitive. > I can't easily imagine a situation where declaring dependencies would be > too much work or not desirable for some other reason but maybe it's just my > imagination not being good enough :). > I wrote an example which demonstrates this in a separate reply to Floris. Outer scopes running before inner scopes does sound kind of logical but > everything running lazily on demand (as it does now) also makes sense. > Just to be clear, in my PR fixtures are still created lazily, it is just that we sort them by scope (preserving order) first. Cheers, Bruno.
_______________________________________________ pytest-dev mailing list pytest-dev@python.org https://mail.python.org/mailman/listinfo/pytest-dev