Changeset e7fb07e for tests/python/template.py
- Timestamp:
- Dec 1, 2007, 3:55:36 PM (17 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 554a9cb
- Parents:
- 2704647 (diff), 55e9018 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/python/template.py
r2704647 re7fb07e 5 5 6 6 def assertCloseEnough(self, first, second, places=5, msg=None): 7 8 9 10 11 12 13 14 15 16 17 18 7 """Fail if the two objects are unequal as determined by their 8 *relative* difference rounded to the given number of decimal places 9 (default 7) and comparing to zero. 10 """ 11 if round(first, places) == 0: 12 if round(second-first, places) != 0: 13 raise self.failureException, \ 14 (msg or '%r != %r within %r places' % (first, second, places)) 15 else: 16 if round((second-first)/first, places) != 0: 17 raise self.failureException, \ 18 (msg or '%r != %r within %r places' % (first, second, places))
Note: See TracChangeset
for help on using the changeset viewer.