Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
super(TestMultiprocessStringIO, self).setUp()
from flaky.multiprocess_string_io import MultiprocessingStringIO
self._string_io = StringIO()
self._mp_string_io = MultiprocessingStringIO()
del self._mp_string_io.proxy[:]
self._string_ios = (self._string_io, self._mp_string_io)
If this nose run is going to use the multiprocess plugin, then use
a multiprocess-list backed StringIO proxy; otherwise, use the default
stream.
:param multiprocess:
Whether or not this test run is configured for multiprocessing.
:type multiprocess:
`bool`
:return:
The stream to use for storing the flaky report.
:rtype:
:class:`StringIO` or :class:`MultiprocessingStringIO`
"""
if multiprocess:
from flaky.multiprocess_string_io import MultiprocessingStringIO
return MultiprocessingStringIO()
return self._stream