From 94d5caed1525e7a64a517993667d3d0535c4e6a7 Mon Sep 17 00:00:00 2001 From: Yannis Spiliopoulos Date: Sun, 24 Jul 2016 09:22:29 -0400 Subject: [PATCH] Make clearer the puprose of test --- tests/test_worker.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/test_worker.py b/tests/test_worker.py index 89e0996..d44990b 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -656,8 +656,8 @@ class WorkerShutdownTestCase(TimeoutTestCase, RQTestCase): @slow def test_work_horse_death_sets_job_failed(self): - """worker with an ongoing job whose work horse dies unexpectadly should - set the job's status either to FINISHED or FAILED + """worker with an ongoing job whose work horse dies unexpectadly (before + completing the job) should set the job's status to FAILED """ fooq = Queue('foo') failed_q = get_failed_queue() @@ -675,13 +675,9 @@ class WorkerShutdownTestCase(TimeoutTestCase, RQTestCase): w.monitor_work_horse(job) job_status = job.get_status() p.join(1) - if os.path.exists(sentinel_file): - self.assertEqual(job_status, JobStatus.FINISHED) - os.remove(sentinel_file) - else: - self.assertEqual(job_status, JobStatus.FAILED) - self.assertEqual(failed_q.count, 1) - self.assertEqual(fooq.count, 0) + self.assertEqual(job_status, JobStatus.FAILED) + self.assertEqual(failed_q.count, 1) + self.assertEqual(fooq.count, 0) def schedule_access_self(): q = Queue('default', connection=get_current_connection())