summaryrefslogtreecommitdiff
path: root/test/LedgerHarness.py
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-15 01:41:51 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-15 01:49:18 -0400
commitfa263e729c65e073950a15db11c149ebacba0937 (patch)
tree8aa9079aa0475cb6c6d0cb2ce1666c13fb3c0d59 /test/LedgerHarness.py
parentf3bedb88b24ae8b2047ad86e57b161265c2812f5 (diff)
downloadfork-ledger-fa263e729c65e073950a15db11c149ebacba0937.tar.gz
fork-ledger-fa263e729c65e073950a15db11c149ebacba0937.tar.bz2
fork-ledger-fa263e729c65e073950a15db11c149ebacba0937.zip
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.
Diffstat (limited to 'test/LedgerHarness.py')
-rwxr-xr-xtest/LedgerHarness.py21
1 files changed, 21 insertions, 0 deletions
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