Reverted "Reduced time.sleep() in cache touch() tests."

This reverts commit 177a49e79c
which caused more frequent failures of test_touch().
This commit is contained in:
Mariusz Felisiak 2020-10-19 19:54:23 +02:00 committed by GitHub
parent b3b0be3df3
commit 0f18255848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -440,15 +440,15 @@ class BaseCacheTests:
def test_touch(self):
# cache.touch() updates the timeout.
cache.set('expire1', 'very quickly', timeout=1)
self.assertIs(cache.touch('expire1', timeout=2), True)
time.sleep(1.0)
self.assertIs(cache.touch('expire1', timeout=4), True)
time.sleep(2)
self.assertIs(cache.has_key('expire1'), True)
time.sleep(1.5)
time.sleep(3)
self.assertIs(cache.has_key('expire1'), False)
# cache.touch() works without the timeout argument.
cache.set('expire1', 'very quickly', timeout=1)
self.assertIs(cache.touch('expire1'), True)
time.sleep(1.5)
time.sleep(2)
self.assertIs(cache.has_key('expire1'), True)
self.assertIs(cache.touch('nonexistent'), False)