Documentation: setup
and teardown
aren't mentioned · Issue #9549 · pytest-dev/pytest (original) (raw)
While browsing the current release docs on "xunit-style" support, specifically the usage of setup and tearing down (cleanup) of tests, I was surprised not to see setup()
and teardown()
mentioned. Instead, the documentation points out that for methods, one must use setup_method()
and teardown_method()
.
I've always used setup()
and teardown()
methods for setting up and cleaning up before and after each test method in a class for production code as well as teaching Pytest.
Are those methods deprecated and shouldn't be used? Supported by mistake? Or is it an omission in the docs? Either way the docs need to be rectified for correctness. I'm happy to provide a PR with the right path.