Skip to content

Commit

Permalink
Avoiding system modules deprecated APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Mar 13, 2020
1 parent 29646c0 commit 1e6220a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/dropmake/test_lg_fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ def test_fill_lg(self):
with open(os.path.join(lg_dir, 'chiles_simple.json')) as f:
lg = pg_generator.fill(json.load(f), params)
for node_idx, value in zip((20, 21, 22, 23), ('1', '2', 'True', 'hi')):
self.assertEquals(lg['nodeDataArray'][node_idx]['Arg10'], value)
self.assertEqual(lg['nodeDataArray'][node_idx]['Arg10'], value)
4 changes: 2 additions & 2 deletions test/manager/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def tearDown(self):
self._dm_server.stop()
self._dm_t.join()
self.dm.shutdown()
self.assertFalse(self._dm_t.isAlive())
self.assertFalse(self._dm_t.is_alive())

self._dim_server.stop()
self._dim_t.join()
self.dim.shutdown()
self.assertFalse(self._dim_t.isAlive())
self.assertFalse(self._dim_t.is_alive())

def test_index(self):
# Just check that the HTML pages load properly
Expand Down
10 changes: 5 additions & 5 deletions test/test_dask_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,23 +171,23 @@ def test_with_user_defined_default(self):
delayed = self.delayed
compute = self.compute

self.assertEquals(compute(delayed(sum_with_user_defined_default)(1)), 11)
self.assertEquals(compute(delayed(sum_with_user_defined_default)(1, MyType(20))), 21)
self.assertEqual(compute(delayed(sum_with_user_defined_default)(1)), 11)
self.assertEqual(compute(delayed(sum_with_user_defined_default)(1, MyType(20))), 21)

def test_with_noniterable_nout_1(self):
"""Tests that using nout=1 works as expected with non-iterable objects"""
# Simple call
delayed = self.delayed
compute = self.compute

self.assertEquals(compute(delayed(add, nout=1)(1, 2)), 3)
self.assertEqual(compute(delayed(add, nout=1)(1, 2)), 3)

# Compute a delayed that uses a delayed with nout=1
addition = delayed(add, nout=1)(1, 2)
self.assertEquals(compute(delayed(add)(addition, 3)), 6)
self.assertEqual(compute(delayed(add)(addition, 3)), 6)

# Like above, but the first delayed also uses nout=1
self.assertEquals(compute(delayed(add, nout=1)(addition, 3)), 6)
self.assertEqual(compute(delayed(add, nout=1)(addition, 3)), 6)

def test_with_iterable_nout_1(self):
"""Tests that using nout=1 works as expected with iterable objects"""
Expand Down
4 changes: 2 additions & 2 deletions test/test_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def test_pipeline(self):
submit = tool.start_process('submit', ['-w', '-i', '0.2'], stdin=map_.stdout)

for proc in fill, unroll, partition, map_, submit:
self.assertEquals(proc.wait(), 0)
self.assertEqual(proc.wait(), 0)

# It actually finished
sessions_status = common.monitor_sessions().values()
self.assertEquals(next(iter(next(iter(sessions_status)))), SessionStates.FINISHED)
self.assertEqual(next(iter(next(iter(sessions_status)))), SessionStates.FINISHED)

0 comments on commit 1e6220a

Please sign in to comment.