Git Product home page Git Product logo

Comments (5)

RKrahl avatar RKrahl commented on June 4, 2024

Erm, why? Could you elaborate?

from pytest-dependency.

benjaminweb avatar benjaminweb commented on June 4, 2024

Sure:
If I decide to test a specific function my_function (because I do some work on it), I expect the test to run.
Since -k does not let run the dependency, the test for my_function is not ran.
I expected the inverse.

from pytest-dependency.

RKrahl avatar RKrahl commented on June 4, 2024

So, in your particular use case, the -k switch happens to run only one single test, but not its dependencies. You may add โ€“ignore-unknown-dependency to the command line, this switch has specifically been added for this situation.

In other use cases, the -k switch might select many tests, including all dependencies. If in this case one of the dependency fails, the user would probably expect pytest-dependency to do its job and skip the dependent test.

from pytest-dependency.

benjaminweb avatar benjaminweb commented on June 4, 2024

I have not been aware of the --ignore-unknown-dependency switch. Thanks for pointing that out.

In other use cases, the -k switch might select many tests, including all dependencies. If in this case one of the dependency fails, the user would probably expect pytest-dependency to do its job and skip the dependent test.

True.

Closing this issue. Resolved by learning about --ignore-unknown-dependency switch.

from pytest-dependency.

benjaminweb avatar benjaminweb commented on June 4, 2024

Or would it be more intuitive to execute the dependency automatically (since the -k matched test would otherwise not run at all)?

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.