diff options
author | Erik Johnston <erik@matrix.org> | 2017-03-28 11:19:15 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-03-30 14:14:46 +0100 |
commit | eefd9fee81428ecec311999980bb4213b6aac2df (patch) | |
tree | 382b11ef8ca0f896ae73c478fc69d7fe3e17b72f /tests/util/test_snapshot_cache.py | |
parent | Manually calculate cache key as getcallargs is expensive (diff) | |
download | synapse-eefd9fee81428ecec311999980bb4213b6aac2df.tar.xz |
Fix up tests
Diffstat (limited to 'tests/util/test_snapshot_cache.py')
-rw-r--r-- | tests/util/test_snapshot_cache.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/util/test_snapshot_cache.py b/tests/util/test_snapshot_cache.py index 7e289715ba..d3a8630c2f 100644 --- a/tests/util/test_snapshot_cache.py +++ b/tests/util/test_snapshot_cache.py @@ -53,7 +53,9 @@ class SnapshotCacheTestCase(unittest.TestCase): # before the cache expires returns a resolved deferred. get_result_at_11 = self.cache.get(11, "key") self.assertIsNotNone(get_result_at_11) - self.assertTrue(get_result_at_11.called) + if isinstance(get_result_at_11, Deferred): + # The cache may return the actual result rather than a deferred + self.assertTrue(get_result_at_11.called) # Check that getting the key after the deferred has resolved # after the cache expires returns None |