From fa263e729c65e073950a15db11c149ebacba0937 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 15 Jun 2010 01:41:51 -0400 Subject: Tests run in parallel with using acprep -jX make This is done using the multiprocessing library in Python 2.6. If that's unavailable, this feature does nothing. --- test/LedgerHarness.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/LedgerHarness.py') diff --git a/test/LedgerHarness.py b/test/LedgerHarness.py index ea8290d4..44e4e61c 100755 --- a/test/LedgerHarness.py +++ b/test/LedgerHarness.py @@ -6,6 +6,27 @@ import re from subprocess import Popen, PIPE +import copy_reg +import types + +def _pickle_method(method): + func_name = method.im_func.__name__ + obj = method.im_self + cls = method.im_class + return _unpickle_method, (func_name, obj, cls) + +def _unpickle_method(func_name, obj, cls): + for cls in cls.mro(): + try: + func = cls.__dict__[func_name] + except KeyError: + pass + else: + break + return func.__get__(obj, cls) + +copy_reg.pickle(types.MethodType, _pickle_method, _unpickle_method) + class LedgerHarness: ledger = None sourcepath = None -- cgit v1.2.3