Exercise

Fixture chaining using tmpdir

The built-in tmpdir fixture is very useful when dealing with files in setup and teardown. tmpdir combines seamlessly with user defined fixture via fixture chaining.

In this exercise, you will use the power of tmpdir to redefine and improve the empty_file() fixture that you wrote in the last exercise and get some experience with fixture chaining.

Instructions 1/2

undefined XP
    1
    2
  • Add the correct argument to the fixture empty_file() so that it chains with the built-in fixture tmpdir.
  • Use the appropriate method to create an empty file "empty.txt" inside the temporary directory created by tmpdir.