From 37484fb02c8f6fcd17066088f60f2c4ba1bab3b4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 6 Aug 2013 12:04:38 +0530 Subject: [PATCH] Fix refresh() test failling on OS X because of file system resolution --- src/calibre/db/tests/legacy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/db/tests/legacy.py b/src/calibre/db/tests/legacy.py index 55610f6401..03abdee26e 100644 --- a/src/calibre/db/tests/legacy.py +++ b/src/calibre/db/tests/legacy.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' -import inspect +import inspect, time from io import BytesIO from repr import repr from functools import partial @@ -126,6 +126,9 @@ class LegacyTest(BaseTest): ' Test refreshing the view after a change to metadata.db ' db = self.init_legacy() db2 = self.init_legacy() + # Ensure that the following change will actually update the timestamp + # on filesystems with one second resolution (OS X) + time.sleep(1) self.assertEqual(db2.data.cache.set_field('title', {1:'xxx'}), set([1])) db2.close() del db2