File: SimpleMultiprocessPlugin.py

package info (click to toggle)
yapsy 1.12.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 888 kB
  • sloc: python: 2,684; makefile: 82
file content (20 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t; python-indent: 4 -*-

"""
A simple multiprocessed plugin that echoes the content received to the parent
"""

from yapsy.IMultiprocessPlugin import IMultiprocessPlugin

class SimpleMultiprocessPlugin(IMultiprocessPlugin):
	"""
	Only trigger the expected test results.
	"""

	def __init__(self, parent_pipe):
		IMultiprocessPlugin.__init__(self, parent_pipe=parent_pipe)

	def run(self):
		content_from_parent = self.parent_pipe.recv()
		self.parent_pipe.send("{0}|echo_from_child".format(content_from_parent))