refactor tests to use a fixture to set up the sample tests and parse the output of test runs more robustly

this should hopefully make the tests easier to read, too...
with d8c71871 pytest < 2.3 won't work any longer, obviously