From: Paul Brossier Date: Fri, 23 Nov 2007 12:32:13 +0000 (+0100) Subject: examples/aubiopitch.py: also print line number and write output file if exception X-Git-Tag: bzr2git~448 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9668a37a6e3038a637e2ca421529354aef965f1b;p=aubio.git examples/aubiopitch.py: also print line number and write output file if exception --- diff --git a/tests/python/examples/aubiopitch.py b/tests/python/examples/aubiopitch.py index 356daa22..1218fb47 100644 --- a/tests/python/examples/aubiopitch.py +++ b/tests/python/examples/aubiopitch.py @@ -52,7 +52,13 @@ class aubiopitch_test_yinfft(program_test_case): """ test aubiopitch with default parameters """ self.getOutput() expected_output = open(os.path.join('examples','aubiopitch','yinfft'+'.'+os.path.basename(self.filename)+'.txt')).read() + lines = 0 for line_out, line_exp in zip(self.output.split('\n'), expected_output.split('\n')): - assert line_out == line_exp, line_exp + " vs. " + line_out + try: + assert line_exp == line_out, line_exp + " vs. " + line_out + " at line " + str(lines) + except: + open(os.path.join('examples','aubiopitch','yinfft'+'.'+os.path.basename(self.filename)+'.txt.out'),'w').write(self.output) + raise + lines += 1 if __name__ == '__main__': unittest.main()