nunit3-vs-adapter: Console.WriteLine() does not write to console when running`dotnet test`
@ayoung commented on Thu Jun 15 2017
I’m running dotnet test targeting netcorapp1.1. Within the test I’m executing a console write but that text never makes it to the output on the screen.
@rprouse commented on Fri Jun 16 2017
Are you using dotnet-test-nunit or the alpha of the adapter for your tests? In other words, project.json or csproj? This issue needs to be moved to the correct repository.
@ayoung commented on Sat Jun 17 2017
i am using the alpha adapter. csproj.
@rprouse commented on Sat Jun 17 2017
Thanks, I am going to move to that repository then. Please track it there.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 6
- Comments: 33 (14 by maintainers)
Commits related to this issue
- Console out enabled as default. Added runsettings proeprty to disable it. #343 — committed to nunit/nunit3-vs-adapter by deleted user 4 years ago
- Use NUnit3TestAdapter 3.17.0-dev-01324 Following https://github.com/nunit/nunit3-vs-adapter/issues/343 — committed to roji/TestConsoleTests by roji 4 years ago
Try use
NUnit.Framework.TestContext.Progress.WriteLine(), it works for me withdotnet test.Same issue… though for me I don’t see stdout lines, even with “-v n” flag Any update?
Great! Gave it a try, and I can confirm that I can see Console.WriteLine (when
-v nis specified).For info, “dotnet test -v n” adds a lot of crap to the console, but at least diplays the stdout lines.
@alfreql Yeah, this is annoying, see https://github.com/dotnet/sdk/issues/10706 . You can get it out doing:
alternatively, if you don’t want the logger approach, change your code to use TestLogger.Progress.WriteLine, that will output with just the
dotnet test -v nCan you please bump the priority of this a bit? Still no progress after nearly a year since the last comment.
This will be fixed in 4.2
Just to have it said: There is something that happened, because the 3.17 DID output the Console, but right now it doesn’t, neither for 3.17 or for 4.X.
Not sure what, but I’ll look into it.