From 5fcedbcdad51c82b5f3112bc3dc24e8e0a6f2f69 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 7 Aug 2012 11:05:50 +0200 Subject: [PATCH] Change assertEqual to assertGreaterThan, to make the test a little less brittle (on slow machines). --- tests/test_queue.py | 2 +- tests/test_worker.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_queue.py b/tests/test_queue.py index 0bfabc3..115e8eb 100644 --- a/tests/test_queue.py +++ b/tests/test_queue.py @@ -254,7 +254,7 @@ class TestFailedQueue(RQTestCase): self.assertEquals(job.timeout, 200) def test_enqueue_preserves_result_ttl(self): - """Ensure that result_ttl argument are properly persisted to Redis.""" + """Enqueueing persists result_ttl.""" q = Queue() job = q.enqueue(div_by_zero, args=(1, 2, 3), result_ttl=10) self.assertEqual(job.result_ttl, 10) diff --git a/tests/test_worker.py b/tests/test_worker.py index 5083a14..a4f47e6 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -96,7 +96,6 @@ class TestWorker(RQTestCase): self.assertEquals(job.enqueued_at, enqueued_at_date) self.assertIsNotNone(job.exc_info) # should contain exc_info - def test_cancelled_jobs_arent_executed(self): # noqa """Cancelling jobs.""" @@ -147,7 +146,6 @@ class TestWorker(RQTestCase): assert self.testconn.ttl(job_with_rv.key) > 0 assert not self.testconn.exists(job_without_rv.key) - @slow # noqa def test_timeouts(self): """Worker kills jobs after timeout.""" @@ -182,12 +180,10 @@ class TestWorker(RQTestCase): job = q.enqueue(say_hello, args=('Frank',), result_ttl=10) w = Worker([q]) w.work(burst=True) - self.assertEqual(self.testconn.ttl(job.key), 10) + self.assertNotEqual(self.testconn.ttl(job.key), 0) # Job with -1 result_ttl don't expire job = q.enqueue(say_hello, args=('Frank',), result_ttl=-1) w = Worker([q]) w.work(burst=True) self.assertEqual(self.testconn.ttl(job.key), None) - -