Git Product home page Git Product logo

Comments (7)

RKrahl avatar RKrahl commented on May 24, 2024 1

I documented the incompatibility with the parallelization in pytest-xdist and closed this issue. However, this is not the full story: pytest-xdist 1.19 added distributing mode loadscope and 1.21 added loadfile. Both distributing modes are compatible with pytest-dependency under certain conditions. But these distributing modes are marked experimental in pytest-xdist. I will wait for them to become stable before documenting this option.

from pytest-dependency.

RKrahl avatar RKrahl commented on May 24, 2024

I never used pytest-xdist by now. I need to investigate. Might take some time.

from pytest-dependency.

RKrahl avatar RKrahl commented on May 24, 2024

I still didn't got a round to investigate this in detail. But after having a short glance on the pytest-xdist documentation, I assume the problem is the following: pytest-xdist features to run the tests in parallel. It seem to do this in parallel processes, each running its own pytest instance. As a result, the dependent test is skipped because its dependency has not been run (in the same parallel instance of pytest). I'm afraid, this is fundamentally incompatible with pytest-dependency, because such a parallelization can only work if the tests are independent from each other. But the very purpose of pytest-dependency is to handle the case that they are not.

If this assumption turn out to be true, the only thing pytest-dependency can do about this problem, is to disable the parallelization in pytest-xdist. I would still need to figure out how to do this.

from pytest-dependency.

RKrahl avatar RKrahl commented on May 24, 2024

I finally got around to take a closer look. My first assumption from the last comment turns out to be right, the problem is the parallelization in pytest-xdist. This can only work if the test are independent from each other.

There is not much that pytest-dependency can do about this. I will refrain from trying to disable the parallelization in pytest-xdist, as I think plugins should not interfere with each other. The only thing I can do is to document this incompatibility.

from pytest-dependency.

Kinzal15 avatar Kinzal15 commented on May 24, 2024

@RKrahl Any workaround for above issue?

from pytest-dependency.

CMCDragonkai avatar CMCDragonkai commented on May 24, 2024

I've tried using --dist=loadfile but then xdist complains and says:

ERROR: MISSING test execution (tx) nodes: please specify --tx

And with --dist=no it doesn't work. The dependencies are being skipped.

from pytest-dependency.

pkoch avatar pkoch commented on May 24, 2024

@RKrahl Can we perhaps piggyback off of --dist loadgroup? If we make every connected test belong to their own group, that seems to compatibilize the interaction between the two packages, no?

from pytest-dependency.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.