Setup/teardown doesn't work as expected #10084
Labels
status: needs information
reporter needs to provide more information; can be closed after 2 or more weeks of inactivity
type: regression
indicates a problem that was introduced in a release which was working previously
After I upgrade pytest from 6.2.5 to 7.0 ( I tested 7.0.0 and 7.1.2), setup/teardown in my frameworks does not work as expected.
in our framework, we have a base test to setup test environment, all tests inherent from base test, and we have setup/teardown in most of tests.
For setup:
Code in test setup are executed before the fixture in base test marked as @pytest.fixture(autouse=True), after I mark the setup in test as @pytest.fixture(autouse=True), then the fixture in base test is executed before the setup.
For teardown:
After the test is executed, the teardown is called, but looks like we lost all environment info when teardown is called, it is failed by:
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=38921): Max retries exceeded with url: /session/d891b3026ea1a85b64dd96d75cf6c245/window/handles (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fc00321ed60>: Failed to establish a new connection: [Errno 111] Connection refused'))
The text was updated successfully, but these errors were encountered: