Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 7
    I realize that that's one possible solution, but it's not always practical. I'm looking for something that works without breaking up one formerly-cohesive test into several little methods. Commented Jan 19, 2011 at 17:29
  • @Bruce Christensen: If they are so cohesive then perhaps they form a story? And then they can be made into doctests, which indeed will continue even after failure. Commented Jan 19, 2011 at 18:17
  • 1
    I have a set of tests, something like this: 1. load data, 2. assert data loaded correctly, 3. modify data, 4. assert modification worked correctly, 5. save modified data, 6. assert data saved correctly. How can I do that with this method? it doesn't make sense to load the data in setup(), because that's one of the tests. But if I put each assertion into its own function, then I have to load data 3 times, and that's a huge waste of resources. What's the best way to deal with a situation like that? Commented Jan 19, 2015 at 7:58
  • Well, tests that test a specific sequence should be in the same test method. Commented Jan 19, 2015 at 14:55