py.test

TO BE DONE

test fixtures and files

py.test tells you temp file paths if test fails.
—> test file not deleted

pytest.org/latest/tmpdir.html

  1. def test_create_file(tempdir):
  2. p = tmpdir.mkdir("sub").join("hello.txt"=
  3. p.write("bla")
  4. assert p.read() == "content"

also see py.path.local

test selection

@slow decorator (see ‘patterns & examples’)

re-run failed tests

  • pyscaffold adds a py.test mode by default.