Re: nunit tests hold onto file handles aftertestsaredone
"Charlie Poole" <[email protected]>
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <000901c8d5fb$fa78afa0$6401a8c0@ferrari> |
Hi David, When you're in the teardown, the test method that was just executed is no longer on the stack. That's why this requires some extra support from NUnit, which knows what test it just finished executing. Charlie _____ From: David Jeske [mailto:[email protected]] Sent: Monday, June 23, 2008 8:13 PM To: Charlie Poole Cc: [email protected] Subject: Re: [Nunit-users] nunit tests hold onto file handles aftertestsaredone On Mon, Jun 23, 2008 at 4:41 PM, Charlie Poole <[email protected]> wrote: As I said, we may have the info you need available to do this in the next release. That said, I think a better approach would be to give the tests two different teardowns: one to cleanup after success, the other after failure. This would be a reasonable solution. It would also be fine if teardown had a (bool testPassed) paramater. However, even that approach has a problem. If a single test fails and you fail to clean up after it, it's likely that subsequent tests won't run correctly. I don't have any problems with a new test not running correctly because something wasn't cleaned up, because I run every test in a unique directory name to assure it doesn't collide with any other test. However, this means the beginning of my test methods all have to include the testname again in the directory create. I don't like having to double-datakeep. I'm thinking I'll just switch to using a reflection stackwalk to get the current method name. http://www.codeproject.com/KB/dotnet/MethodName.aspx ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Nunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nunit-users