Skip to content

Commit

Permalink
contextlib.nested was removed in python 3, using native syntax instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Bernhardsson committed Nov 29, 2015
1 parent 69a5a63 commit 05a89de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/worker_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import threading
import time
import psutil
import contextlib
from helpers import unittest, with_config, skipOnTravis, LuigiTestCase

import luigi.notifications
Expand Down Expand Up @@ -113,8 +112,8 @@ class WorkerTest(unittest.TestCase):
def run(self, result=None):
self.sch = CentralPlannerScheduler(retry_delay=100, remove_delay=1000, worker_disconnect_delay=10)
self.time = time.time
with contextlib.nested(Worker(scheduler=self.sch, worker_id='X'),
Worker(scheduler=self.sch, worker_id='Y')) as (w, w2):
with Worker(scheduler=self.sch, worker_id='X') as w, \
Worker(scheduler=self.sch, worker_id='Y') as w2:
self.w = w
self.w2 = w2
super(WorkerTest, self).run(result)
Expand Down

0 comments on commit 05a89de

Please sign in to comment.