diff --git a/rq/registry.py b/rq/registry.py index 7c25cab..4d55d74 100644 --- a/rq/registry.py +++ b/rq/registry.py @@ -231,6 +231,7 @@ class FailedJobRegistry(BaseRegistry): job_class=self.job_class) job.started_at = None job.ended_at = None + job.exc_info = '' job.save() job = queue.enqueue_job(job, pipeline=pipeline) pipeline.execute() diff --git a/tests/test_cli.py b/tests/test_cli.py index e7f94fd..e653355 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -386,12 +386,10 @@ class TestRQCli(RQTestCase): prefix = 'Enqueued tests.fixtures.say_hello() with job-id \'' suffix = '\'.\n' - print(result.stdout) + self.assertTrue(result.output.startswith(prefix)) + self.assertTrue(result.output.endswith(suffix)) - self.assertTrue(result.stdout.startswith(prefix)) - self.assertTrue(result.stdout.endswith(suffix)) - - job_id = result.stdout[len(prefix):-len(suffix)] + job_id = result.output[len(prefix):-len(suffix)] queue_key = 'rq:queue:default' self.assertEqual(self.connection.llen(queue_key), 1) self.assertEqual(self.connection.lrange(queue_key, 0, -1)[0].decode('ascii'), job_id) diff --git a/tests/test_registry.py b/tests/test_registry.py index 0dd7772..9603bca 100644 --- a/tests/test_registry.py +++ b/tests/test_registry.py @@ -357,6 +357,7 @@ class TestFailedJobRegistry(RQTestCase): self.assertEqual(job.get_status(), JobStatus.QUEUED) self.assertEqual(job.started_at, None) self.assertEqual(job.ended_at, None) + self.assertEqual(job.exc_info, '') worker.work(burst=True) self.assertTrue(job in registry)