On 11.10.2013, at 12:57, holger krekel <[email protected]> wrote:

> On Fri, Oct 11, 2013 at 12:51 +0200, Florian Schulze wrote:
>> I would expect the behaviour you describe for scope="each" to be the default 
>> for a fixture without a scope. Why introduce a new scope for that? Am I 
>> missing something? I haven't used pytest for such complex things yet.
> 
> Defaulting to scope="each" is an interesting proposition but it
> would be largely backward-compatible and i think in real situations. 
> Consider a fixture like this:
> 
>    @pytest.fixture
>    def db(...):
>        return DbInstance()
> 
> and then a test and other fixtures using this "db" fixture.  They
> would all get distinct instances (people using fixtures more extensively
> implicitly rely on the current per-test "sharing" of resources and i think
> it makes sense, just not for all resources).

Ah, I think I get the difference now.

Regards,
Florian Schulze

_______________________________________________
Pytest-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to