'Invalid file data handled.'

def test_invalid_file_data(self):

    invalid_file = FilePath(self.mktemp())
    with invalid_file.open('w') as f:
        f.write('hello\n')
    options = BenchmarkOptions()
    options.parseOptions(['--userdata', '@{}'.format(invalid_file.path)])
    with capture_stderr() as captured_stderr:
        exception = self.assertRaises(SystemExit, parse_userdata, options)
        self.assertIn('Invalid    user    data', exception.args[0])
        self.assertIn(options.getUsage(), captured_stderr())
