shithub: aubio

Download patch

ref: 9668a37a6e3038a637e2ca421529354aef965f1b
parent: a2f3555489f509d3c223f44a356da960f9974a5f
author: Paul Brossier <piem@piem.org>
date: Fri Nov 23 08:32:13 EST 2007

examples/aubiopitch.py: also print line number and write output file if exception

--- a/tests/python/examples/aubiopitch.py
+++ b/tests/python/examples/aubiopitch.py
@@ -52,7 +52,13 @@
     """ 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()
--