Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite tearDown methods to cleanups (addCleanup) #534

Closed
voodam opened this issue Oct 10, 2023 · 0 comments · Fixed by #562
Closed

Rewrite tearDown methods to cleanups (addCleanup) #534

voodam opened this issue Oct 10, 2023 · 0 comments · Fixed by #562
Assignees
Labels
good to start Start form this tasks if you're new in the framework Infrastructure The framework reworking and extensions

Comments

@voodam
Copy link
Contributor

voodam commented Oct 10, 2023

Problem

tearDown assumes that code will be called only if setUp is successful (see https://github.com/python/cpython/blob/main/Lib/unittest/case.py#L639). This is not our case in most (or all) cases where tearDown is used. This problem may leads to many seemingly unrelated test failures as well as cascade failures in pipline runs.

Solution

Use cleanups instead everywhere code should be called regardless of setUp fail (on any stage). Cleanups called separately, so exeptions in it won't break another cleanups. Pay attention to cleanup order of execution though.

Why this issue probably should be prioritized

This fix easy to do and probably it will make tests way more stable.

@krizhanovsky krizhanovsky added the Infrastructure The framework reworking and extensions label Oct 10, 2023
@krizhanovsky krizhanovsky added this to the 1.0 - GA milestone Oct 10, 2023
@krizhanovsky krizhanovsky added the good to start Start form this tasks if you're new in the framework label Oct 10, 2023
@krizhanovsky krizhanovsky modified the milestones: 1.0 - GA, Beta Oct 10, 2023
@ykargin ykargin self-assigned this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good to start Start form this tasks if you're new in the framework Infrastructure The framework reworking and extensions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants