User Tools

Site Tools


fixture

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:

  • The reuse of the arrangement code.
  • A single initial state for a group of tests.
  • Simplification and reduction of tests.

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.
fixture.txt · Last modified: by plida