Comments (6)
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.
Oh, so the bug is that it still worked in pytest 8.0.x, is that it ?
from pytest.
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.
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.
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.
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)
- 8.1.1 raises exception if `boto` is imported in environment HOT 3
- Pytest-watch with coverage (If not existent) HOT 1
- List of disabled plugins is not passed down to `runpytest()`
- Sporadically encountering SyntaxError HOT 7
- No output written to JUnit XML files
- AttributeError with import-mode importlib and doctest modules HOT 7
- log-disable as pytest.ini configuration option does not have any effect HOT 3
- Pytest keeps reference to attributes of failed test cases for too long HOT 4
- Conditional test parametrization HOT 3
- tmp_path_factory documentation has circular links HOT 3
- Pytest does not capture teardown logs if a fixture throws an exception
- ExceptionGroup traceback of session fixture unlimitedly grows from test to test HOT 1
- Missing `py.process` HOT 2
- 8.2.0 release planning
- Adding parameterized fixture in pytest_generate_test is not executing the fixture's code, even if it is marked as "indirect"
- setUpModule/tearDownModule not invoked HOT 4
- junit-xml output attribute can be too big to handle with -vv
- More granular scripting interface HOT 4
- support an alternate syntax for "not" (as in `pytest -m "not stuff"`) HOT 6
- Documentation request: types/shapes of options in `[tool.pytest.ini_options]` HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest.