From 3aa7aebf87452151a7ee1895d15797d746ce0836 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Tue, 27 Oct 2015 14:41:20 +0000 Subject: [PATCH] remove assert_dt_between from worker tests --- tests/test_worker.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/test_worker.py b/tests/test_worker.py index 8aafd83..a0cdeac 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -83,10 +83,6 @@ class TestWorker(RQTestCase): 'Expected at least some work done.') self.assertEquals(job.result, 'Hi there, Frank!') - def assert_dt_between(self, dt, before, after): - if not before <= dt <= after: # pragma: no cover - raise AssertionError('Not %s <= %s <= %s' % (before, dt, after)) - def test_job_times(self): """job times are set correctly.""" q = Queue('foo') @@ -102,9 +98,9 @@ class TestWorker(RQTestCase): self.assertEquals(job.result, 'Hi there, Stranger!') after = utcnow() job.refresh() - self.assert_dt_between(job.enqueued_at, before, after) - self.assert_dt_between(job.started_at, before, after) - self.assert_dt_between(job.ended_at, before, after) + self.assertTrue(before <= job.enqueued_at <= after, 'Not %s <= %s <= %s' % (before, job.enqueued_at, after)) + self.assertTrue(before <= job.started_at <= after, 'Not %s <= %s <= %s' % (before, job.started_at, after)) + self.assertTrue(before <= job.ended_at <= after, 'Not %s <= %s <= %s' % (before, job.ended_at, after)) def test_work_is_unreadable(self): """Unreadable jobs are put on the failed queue."""