Git Product home page Git Product logo

Comments (12)

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


To be more precise and make sure i understand: collecting yield-based tests needs setupstate and when further items are collected, the state may be teared down and thus when the yield-tests actually run, the setupstate needs to be recreated a second time. Right?

Now i wonder: why can the setup state not be created a second time?
And if that cannot happen, could the machinery be rewritten to use pytest_generate_tests?

feel free to also point me to the repo and exact code you are talking about.

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


ronny, what's the status of this issue and can you provide an exact example of what shoudl be fixed here?

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


im not sure what/how to fix, the problem is that yield tests need a setupstate in collection,
in the case of moint the generate a local wiki instance and prepare data
since the setupstate is removed when tests in a different hierachy run, the yielded closures break since the setup state changed

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


can you provide a minimal failing code example?

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


finally had a good idea for a minimal case

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


I assume, yield/setupstate is not an issue anymore, given that moinmoin now uses a more modern version.

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


its still an isse, moinmoin has a hack in place to work around

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


basically it will stay an issue till we provide a different way to have partial failures without stopping the complete test

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


I am not sure if we should pursue any improvements to yield-based tests. In any case, i don't know what the actual idea here is for improving yield-based setup. Doing larger scale refactorings just for better yield support does not seem worthwhile to me. It might be acceptable if better comes out as a side effect and the refactoring is useful for other reasons.

If nothing happens on this issue for a couple of months i'd like to close it.

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


i hit yet another proejct where this prevents pytest usage

the suggested solution is to drop collecting yield items, and make reporting prettier later

from pytest.

pytestbot avatar pytestbot commented on August 28, 2024

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


addresses #16 - replace Generator with pytest_pyfunc_interpret_result

from pytest.

RonnyPfannschmidt avatar RonnyPfannschmidt commented on August 28, 2024

finally addressed in #1714

from pytest.

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.