mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 01:25:47 +01:00
Use assertAlmostEqual (#1054)
Rounding and then comparing could lead to some surprising sensitivity. This uses a known-good approximate comparison.
This commit is contained in:
parent
256a3b4055
commit
832d658571
1 changed files with 1 additions and 2 deletions
|
|
@ -74,8 +74,7 @@ class ImportAddedTest(unittest.TestCase, ImportHelper):
|
|||
|
||||
def assertEqualTimes(self, first, second, msg=None):
|
||||
"""For comparing file modification times at a sufficient precision"""
|
||||
assert round(first, 4) == round(second, 4), \
|
||||
"{:f} != {:f}{}".format(first, second, ": " + msg if msg else "")
|
||||
self.assertAlmostEqual(first, second, places=4, msg=msg)
|
||||
|
||||
def test_import_album_with_added_dates(self):
|
||||
self.importer.run()
|
||||
|
|
|
|||
Loading…
Reference in a new issue