Giter VIP home page Giter VIP logo

Comments (5)

smarie avatar smarie commented on May 31, 2024

Thanks @j-carson ! This is a very nice way indeed to fix this issue. However if results_bag is not explicitly declared as a test dependency in your test function, request.getfixturevalue("results_bag") might not work.

Therefore, I would suggest the following, I suspect that it works too:

@pytest.fixture
@one_fixture_per_step
def step_bag(results_bag):
    return results_bag

Do you confirm ?

More generally I think that your proposal could make a great addition to pytest-steps. However it should be optional: if this fixture is provided by the plugin, and the user does not use it in any of its tests, the user should not need pytest-harvest to be installed. I think that with the above design, as long as "auto use" is not on, this is the pytest default behaviour. Do you confirm ?

from python-pytest-steps.

j-carson avatar j-carson commented on May 31, 2024

The shorter implementation of step_bag fixture works for me.

I think that with the above design, as long as "auto use" is not on, this is the pytest default behaviour. Do you confirm ?

I will need to write a test case to verify this second question.

from python-pytest-steps.

j-carson avatar j-carson commented on May 31, 2024

Wrote the test case for above: In a virtualenv with pytest-steps installed but not pytest-harvest, the above fixture will not cause an error if that fixture is not used by any test.

from python-pytest-steps.

smarie avatar smarie commented on May 31, 2024

Cool ! Then it seems that all lights are green :)
Would you like to propose a PR then ?

The fixture would need to live in module plugin.py and have at least one dedicated test. If you feel like updating the documentation markdown accordingly

(No need to test the case when the pytest-harvest plugin is not installed, this is a pytest mechanism and it wont change over time).

let me know !

from python-pytest-steps.

smarie avatar smarie commented on May 31, 2024

Fixed by #46

from python-pytest-steps.

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.