Sources:

  1. Software Testing course at ITMO university by Kochubeev Nikolay Sergeevich

Fixtures

Fixture is a defined and reliable context for the tests.

It is useful because of:

Best practices

  1. The fixtures should be minimal — just what is needed for the tests.
  2. Use SetUp/Teardown to clear resources.
  3. In Python and Go, it is convenient to use yield/defer to free up resources.