We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
The ClassCleanup is not executed when Ignore (Attribute) is applied to the first test method in a series of test methods in a test class.
The following code reproduces the issue. You can set a breakpoint in ClassCleanup method and observe that it is not executed.
ClassCleanup
Note that the ClassCleanup method is executed if we move the [Ignore] attribute from TestMethod1 to TestMethod2 instead.
[Ignore]
TestMethod1
TestMethod2
I am able to reproduce the bug with MSTest 3.8.0.
namespace UnitTestBugRepro { using System; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class UnitTest1 { [ClassInitialize()] public static void ClassInit(TestContext context) { Console.WriteLine("Class Init"); } [ClassCleanup(ClassCleanupBehavior.EndOfClass)] public static void ClassCleanup() { Console.WriteLine("Class Cleanup"); } [Ignore] [TestMethod] public void TestMethod1() { Console.WriteLine("TestMethod1"); } [TestMethod] public void TestMethod2() { Console.WriteLine("TestMethod2"); } } }
TestMethod1() is ignored and ClassCleanup() method is executed.
TestMethod1()
ClassCleanup()
TestMethod1() is ignored and ClassCleanup() method is not executed.
The text was updated successfully, but these errors were encountered:
Thank you for reporting this @minghan. I'm able to reproduce this, and will investigate.
Sorry, something went wrong.
This regression started from 3.6.0 (likely PR: #3339)
Youssef1313
Successfully merging a pull request may close this issue.
Describe the bug
The ClassCleanup is not executed when Ignore (Attribute) is applied to the first test method in a series of test methods in a test class.
Steps To Reproduce
The following code reproduces the issue. You can set a breakpoint in
ClassCleanup
method and observe that it is not executed.Note that the
ClassCleanup
method is executed if we move the[Ignore]
attribute fromTestMethod1
toTestMethod2
instead.I am able to reproduce the bug with MSTest 3.8.0.
Expected behavior
TestMethod1()
is ignored andClassCleanup()
method is executed.Actual behavior
TestMethod1()
is ignored andClassCleanup()
method is not executed.The text was updated successfully, but these errors were encountered: