From 771c4539fa0f64398c0837a81a15ee10679b2768 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Wed, 29 Jun 2016 16:51:35 -0400 Subject: [PATCH] Document the interaction of autouse scopes I wouldn't have even attempted what I did to cause #1688 if this had been there. --- doc/en/fixture.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/en/fixture.rst b/doc/en/fixture.rst index 590649b560d..3c7033f83c0 100644 --- a/doc/en/fixture.rst +++ b/doc/en/fixture.rst @@ -798,6 +798,10 @@ If we run it, we get two passing tests:: Here is how autouse fixtures work in other scopes: +- autouse fixtures obey the ``scope=`` keyword-argument: if an autouse fixture + has ``scope='session'`` it will only be run once, no matter where it is + defined. ``scope='class'`` means it will be run once per class, etc. + - if an autouse fixture is defined in a test module, all its test functions automatically use it.