On Tue, Mar 20 2018, Bruno Oliveira wrote:

> On Sat, Mar 17, 2018 at 6:38 PM Floris Bruynooghe <f...@devork.be> wrote:
>
>>
>> I'm still not following this, I'm probably being silly.  You have 4
>> autouse session-scoped fixtures but with a dependecy chain as
>> my_db_setup -> my_setup_logging -> setup_logging and then an unrelated
>> db_setup.  What am I missing here?
>>
>
> Oh my bad, db_setup should be a dependency of my_db_setup:
>
> @pytest.fixture(scope='session', autouse=True)
> def my_setup_logging(log_setup): pass
>
> @pytest.fixture(scope='session', autouse=True)
> def my_db_setup(my_setup_logging, db_setup): pass

To me this looks like it still depends on the order of fixtures being
used.  the end now depends on two chains: my_setup_logging -> log_setup
and db_setup (single-item-chain).  But there's nothing, other then the
rule under discussion, which prioritises one chain over the other.

Mind you, I'm by now perfectly fine with the rule.  I'm only discussing
it to understand the semantics of the world without that rule as just a
curious exercise.


Cheers,
Floris
_______________________________________________
pytest-dev mailing list
pytest-dev@python.org
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to