diff --git a/test/unit/common/test_manager.py b/test/unit/common/test_manager.py index 17d66e0d71..865fcc3b80 100644 --- a/test/unit/common/test_manager.py +++ b/test/unit/common/test_manager.py @@ -610,14 +610,14 @@ class TestServer(unittest.TestCase): self.assertEqual(pid_file, self.join_run_dir('proxy-server.pid')) self.assertEqual(pid, 1) # ... and only one file - self.assertRaises(StopIteration, iterator.next) + self.assertRaises(StopIteration, next, iterator) # test invalid value in pid file server = manager.Server('auth', run_dir=t) pid_file, pid = next(server.iter_pid_files()) self.assertIsNone(pid) # test object-server doesn't steal pids from object-replicator server = manager.Server('object', run_dir=t) - self.assertRaises(StopIteration, server.iter_pid_files().next) + self.assertRaises(StopIteration, next, server.iter_pid_files()) # test multi-pid iter server = manager.Server('object-replicator', run_dir=t) real_map = { @@ -1129,9 +1129,13 @@ class TestServer(unittest.TestCase): self.assertEqual(len(server.procs), 3) proc = server.procs[2] # assert stdout is /dev/null - self.assertTrue(isinstance(proc.stdout, file)) + with open('/dev/null', 'wb+') as fp: + self.assertTrue(isinstance(proc.stdout, type(fp))) self.assertEqual(proc.stdout.name, os.devnull) - self.assertEqual(proc.stdout.mode, 'w+b') + self.assertIn('b', proc.stdout.mode) + self.assertTrue(any(x in proc.stdout.mode for x in 'aw+'), + 'mode must be writable, not %r' % + proc.stdout.mode) self.assertEqual(proc.stderr, proc.stdout) # test not daemon over-rides wait server.spawn(conf4, wait=False, daemon=False, once=True) diff --git a/tox.ini b/tox.ini index a3f30b67d8..582be62aa3 100644 --- a/tox.ini +++ b/tox.ini @@ -31,6 +31,7 @@ commands = nosetests \ test/unit/common/test_exceptions.py \ test/unit/common/test_header_key_dict.py \ + test/unit/common/test_manager.py \ test/unit/common/test_splice.py [testenv:py35]