summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-27 00:48:30 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-27 00:48:30 +0000
commit3bafa92366dc85bb139048e621aaa51001bec03b (patch)
treef4a40ab012a9f6cde8cf79c5e9bbaaf24112b725
parent95d0e9c226edb5bfde26808b1298890f62949889 (diff)
downloadportage-3bafa92366dc85bb139048e621aaa51001bec03b.tar.gz
portage-3bafa92366dc85bb139048e621aaa51001bec03b.tar.bz2
portage-3bafa92366dc85bb139048e621aaa51001bec03b.zip
Fix test breakage due to change in calling order of AsynchronousTask start
listeners from r12713. svn path=/main/trunk/; revision=12717
-rw-r--r--pym/portage/tests/process/test_poll.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/pym/portage/tests/process/test_poll.py b/pym/portage/tests/process/test_poll.py
index ebcc822ef..904930410 100644
--- a/pym/portage/tests/process/test_poll.py
+++ b/pym/portage/tests/process/test_poll.py
@@ -33,7 +33,13 @@ class PipeReaderTestCase(TestCase):
task_scheduler = TaskScheduler(max_jobs=2)
scheduler = task_scheduler.sched_iface
- producer = SpawnProcess(
+ class Producer(SpawnProcess):
+ def _spawn(self, args, **kwargs):
+ rval = SpawnProcess._spawn(self, args, **kwargs)
+ os.close(kwargs['fd_pipes'][1])
+ return rval
+
+ producer = Producer(
args=["bash", "-c", "echo -n '%s'" % test_string],
fd_pipes={1:slave_fd}, scheduler=scheduler)
@@ -44,10 +50,6 @@ class PipeReaderTestCase(TestCase):
task_scheduler.add(producer)
task_scheduler.add(consumer)
- def producer_start_cb(task):
- os.close(slave_fd)
-
- producer.addStartListener(producer_start_cb)
task_scheduler.run()
self._assertEqual(test_string, consumer.getvalue())