Currently when you declare a module scoped fixture, it'll be created in the setup_all function of any test module that it gets imported into. This is fine for a first pass, but it'd be good to make sure that it only actually gets created for test modules that specifically require it.
There's 2 ways I can see this working:
We create a module-specific "fixture store" that can store module scoped fixtures that have been created for this module. When we encounter a test that requires a module scoped fixture it could get stored in here, ready for re-use by other tests. This would be broadly similar to what we'd need for #15. The setup_all on_exit function of a module could shut this down.
We somehow find a way to register which fixtures are used in a module, and then use that in the setup_all.
I think I prefer option 1, but be good to think about it.
Currently when you declare a module scoped fixture, it'll be created in the setup_all function of any test module that it gets imported into. This is fine for a first pass, but it'd be good to make sure that it only actually gets created for test modules that specifically require it.
There's 2 ways I can see this working:
on_exit
function of a module could shut this down.I think I prefer option 1, but be good to think about it.