You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AssemblyCleanup/ClassCleanup method is not called if AssemblyInitialize/ClassInitialize method fails.
It would make sense to have the ability to cleanup partially initialized tests runs just like TestInitialize/TestCleanup.
See below comment regarding previous decision to break compatibility with MSTestV1 and support execution of TestCleanup even after TestInitialize failure.
@arnonax : Thanks for making this explicit. This was a conscious compat break to give unit test writers a choice to cleanup partially initialized methods. However in order to make the transition from v1 extremely smooth, it does make sense to have some setting to preserve compat.
The AssemblyCleanup and ClassCleanup methods should have a chance to run.
Actual behavior
The initialization methods throw and their corresponding cleanup method is not run.
The text was updated successfully, but these errors were encountered:
andrewphamvk
changed the title
AssemblyCleanup should be called even if AssemblyInitialize fails
Assembly & Class Cleanup should be called even if Initialize fails
Mar 3, 2020
Description
AssemblyCleanup/ClassCleanup method is not called if AssemblyInitialize/ClassInitialize method fails.
It would make sense to have the ability to cleanup partially initialized tests runs just like TestInitialize/TestCleanup.
See below comment regarding previous decision to break compatibility with MSTestV1 and support execution of TestCleanup even after TestInitialize failure.
Steps to reproduce
AssemblyInitialize/AssemblyCleanup
Output
ClassInitialize/ClassCleanup
Output
TestInitialize/TestCleanup
Output
Expected behavior
The AssemblyCleanup and ClassCleanup methods should have a chance to run.
Actual behavior
The initialization methods throw and their corresponding cleanup method is not run.
The text was updated successfully, but these errors were encountered: