projects
/
sawsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Escape LaTeX backslashes in pysawsim.test.constant_rate.
[sawsim.git]
/
pysawsim
/
invoke.py
diff --git
a/pysawsim/invoke.py
b/pysawsim/invoke.py
index 165701c3f84d0ad7ad5a45af2a7655219b9829da..2d8103fab178e6dab14ae1eb298e3e881c89ec23 100644
(file)
--- a/
pysawsim/invoke.py
+++ b/
pysawsim/invoke.py
@@
-24,6
+24,11
@@
from subprocess import Popen, PIPE
import sys
import sys
+_multiprocess_can_split_ = True
+"""Allow nosetests to split tests between processes.
+"""
+
+
class CommandError(Exception):
"""Represent errors in command execution.
class CommandError(Exception):
"""Represent errors in command execution.
@@
-39,6
+44,9
@@
class CommandError(Exception):
<BLANKLINE>
while executing
somefunc
<BLANKLINE>
while executing
somefunc
+ >>> print repr(b) # doctest: +NORMALIZE_WHITESPACE
+ CommandError(command='somefunc', status=1, stdout='',
+ stderr='could not find "somefunc"')
"""
def __init__(self, command=None, status=None, stdout=None, stderr=None):
self.command = command
"""
def __init__(self, command=None, status=None, stdout=None, stderr=None):
self.command = command
@@
-59,6
+67,12
@@
class CommandError(Exception):
"while executing\n %s" % self.command,
])
"while executing\n %s" % self.command,
])
+ def __repr__(self):
+ return '%s(%s)' % (
+ self.__class__.__name__,
+ ', '.join(['%s=%s' % (attr, repr(getattr(self, attr)))
+ for attr in ['command', 'status', 'stdout', 'stderr']]))
+
def invoke(cmd_string, stdin=None, expect=(0,), cwd=None, verbose=False):
"""
def invoke(cmd_string, stdin=None, expect=(0,), cwd=None, verbose=False):
"""