-
Notifications
You must be signed in to change notification settings - Fork 51
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
TearDown : System.InvalidOperationException #320
Comments
+1 |
I just experienced the same problem. The problem lies in the incompatibility with NUnit 4.0.0+. Tests don't break up until NUnit 3.14. |
@russog @D0nGiovanni @konarx Stupid question, but I guess you don't have any |
Also could you please tell the exact version number of NUnit you use and get the error? |
@gasparnagy yes, but in a separate project not the one that gives me trouble, |
NUnit: 4.2.2 |
@russog do you think this have any relation to the issue (are the projects refer each-other)? Do you still get the error if you temporarily comment out those |
nope. just to be sure I run from the command line dotnet test the other one is not referenced in it. |
btw you guys are doing an amazing job ;) |
I am trying it with the refs as
But works for me. Maybe any special NUnit assembly-level attribute? Also one more: |
@gasparnagy no, but I have a <PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.Playwright" Version="1.48.0" />
<PackageReference Include="Polly" Version="8.4.2" />
<PackageReference Include="ReportPortal.Extensions.SourceBack" Version="2.1.0" />
<PackageReference Include="ReportPortal.Reqnroll" Version="1.1.0" />
<PackageReference Include="Reqnroll.NUnit" Version="2.2.0" />
<PackageReference Include="RestSharp" Version="112.1.0" />
<PackageReference Include="nunit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="FluentAssertions" Version="6.12.2" />
<PackageReference Include="JunitXml.TestLogger" Version="4.1.0" /> |
No, I specifically checked my all my files. I found the culprit in the generated
NUnit: 4.0.0+ |
ReqnrollMinimalRepro.zip |
@D0nGiovanni Strange. I do see the warning with your repo when using I have VS 17.11.4 |
I found the problem. Fix is on the way. |
…alidOperationException : Only static OneTimeSetUp and OneTimeTearDown are allowed for InstancePerTestCase mode.` (#320)
…alidOperationException : Only static OneTimeSetUp and OneTimeTearDown are allowed for InstancePerTestCase mode.` (#323) * Fix: NUnit projects fail or provide warning as `TearDown : System.InvalidOperationException : Only static OneTimeSetUp and OneTimeTearDown are allowed for InstancePerTestCase mode.` (#320) * Add tests
please update to 2.2.1 |
@gasparnagy it works like a charm you definitely rock! |
Reqnroll Version
2.2.0
Which test runner are you using?
NUnit
Test Runner Version Number
latest
.NET Implementation
.NET 8.0
Test Execution Method
Command line – PLEASE SPECIFY THE FULL COMMAND LINE
Content of reqnroll.json configuration file
dotnet test
Issue Description
TearDown : System.InvalidOperationException : Only static OneTimeSetUp and OneTimeTearDown are allowed for InstancePerTestCase mode.
--TearDown
at NUnit.Framework.Internal.Execution.StaticMethodValidator.Validate(MethodInfo method)
at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunSetUpOrTearDownMethod(TestExecutionContext context, IMethodInfo method)
at NUnit.Framework.Internal.Commands.SetUpTearDownItem.RunTearDown(TestExecutionContext context)
Steps to Reproduce
dotnet test or simply run the test runner
Link to Repro Project
No response
The text was updated successfully, but these errors were encountered: