docs
docs copied to clipboard
Scenario for RequiresThread Attribute on Assembly level?
Hi all,
Referring to: https://github.com/nunit/docs/wiki/RequiresThread-Attribute
does anyone know a scenario for putting the RequiresThread attribute on Assembly level? Reason for this question is that we observed that anyway - even without the attribute - a separate thread is started for each assembly. This seems to be true for at least console runner and running tests with Resharper.
It would be very helpful for me to know in what cases it is useful to have this attribute on assembly level. Any help will be highly appreciated. Thanks in advance!
It may have made sense in older versions of NUnit, but probably doesn't these days. Use it on a method that intentionally corrupts the thread context in order to avoid reusing the thread on other tests. Most people should never use it.