From 9668a37a6e3038a637e2ca421529354aef965f1b Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 23 Nov 2007 13:32:13 +0100 Subject: [PATCH] examples/aubiopitch.py: also print line number and write output file if exception --- tests/python/examples/aubiopitch.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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() -- 2.26.2