Giter VIP home page Giter VIP logo

Comments (6)

bluetech avatar bluetech commented on May 27, 2024

setup was part of nose compatibility which is removed in pytest 8: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose

Use setup_module instead.

from pytest.

neutrinoceros avatar neutrinoceros commented on May 27, 2024

Oh, so the bug is that it still worked in pytest 8.0.x, is that it ?

from pytest.

neutrinoceros avatar neutrinoceros commented on May 27, 2024

I would expect that changing def setup() -> def setup_module() wouldn't change how pytest behaves at all, but this doesn't seem to be the case: I'm actually seeing a bunch of surprising failures when I do just that (see https://github.com/yt-project/yt/pull/4852/checks). Admittedly, our test suite is too complex to easily analyse and I wouldn't be surprise if what we're seeing here was a symptom of test pollution, but I'm still surprised that this wasn't visible before. Any clue ?

from pytest.

bluetech avatar bluetech commented on May 27, 2024

I would expect that changing def setup() -> def setup_module() wouldn't change how pytest behaves at all

This is the expectation.

I tried to take a look but the project is quite formidable so I can't quickly figure out what's going wrong.

Is it possible that the breakage is from upgrading to pytest 8 and not necessarily from setup -> setup_module? One way to check this is to do the setup_module change with the pytest<8 pin and see what happens (setup_module is not a new thing so this is fully backward compatible).

from pytest.

neutrinoceros avatar neutrinoceros commented on May 27, 2024

I tried to take a look but the project is quite formidable so I can't quickly figure out what's going wrong.

yeah we have a lot of technical debt. Thanks for taking a shot still :)

Is it possible that the breakage is from upgrading to pytest 8 and not necessarily from setup -> setup_module? One way to check this is to do the setup_module change with the pytest<8 pin and see what happens (setup_module is not a new thing so this is fully backward compatible).

I'll try that !

from pytest.

neutrinoceros avatar neutrinoceros commented on May 27, 2024

So actually what happened is that I forgot to also migrate def teardown() -> def teardown_module(). Everything looks good now so I think we can just close this. Thanks @bluetech for your feedback !

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.