git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to re-use setups in multiple tests?

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 1, 2007, 11:45 UTC
Message-ID
<Pine.LNX.4.64.0710011243230.28395@racer.site>
In-Reply-To
<550f9510710010327l3e729ff1tbbb9b6c674c1cb11@mail.gmail.com>
Hi,
On Mon, 1 Oct 2007, Tom Clarke wrote:
Show 5 quoted lines
> I'm wondering if there's a pattern for re-using setups across several 
> tests, similar to how a setUp function is used in xUnit. The problem is 
> I need the setup to actually be re-run, for each test to start from a 
> clean slate, so using the following doesn't work as the setup is just 
> run before the first test.
We typically do the clean up phase explicitely.  Or avoid it.
Example: you want to do something to a branch, but the next step should 
use the original state of the branch.
Solution: "git checkout -b new-branch HEAD~5"

Sorry, unless you are a little less mysterious about the exact use case you have in mind, I cannot help more.

Ciao, Dscho

Previous: Tom ClarkeNext: Tom Clarke
Message 2 of 6 in “How to re-use setups in multiple tests?”
  1. Tom ClarkeOct 1, 2007
  2. Johannes SchindelinOct 1, 2007
  3. Tom ClarkeOct 1, 2007
  4. Johannes SchindelinOct 1, 2007
  5. Tom ClarkeOct 1, 2007
  6. Karl HasselströmOct 1, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.