def testThreading(self):
    data = (b'1' * (2 ** 20))
    nthreads = 10
    with BZ2File(self.filename, 'wb') as f:

        def comp():
            for i in range(5):
                f.write(data)
        threads = [threading.Thread(target=comp) for i in range(nthreads)]
        with threading_helper.start_threads(threads):
            pass
def testThreading(self):
    data = (b'1' * (2 ** 20))
    nthreads = 10
    with BZ2File(self.filename, 'wb') as f:

        def comp():
            for i in range(5):
                f.write(data)
        threads = [threading.Thread(target=comp) for i in range(nthreads)]
        with threading_helper.start_threads(threads):
            pass