aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Masood Malekghassemi <soltanmm@users.noreply.github.com>2015-08-25 12:36:41 -0400
committerGravatar Masood Malekghassemi <soltanmm@users.noreply.github.com>2015-08-25 12:36:41 -0400
commit9639b81a21eb4b1d6c3d456c2fab20ff254fa7cd (patch)
tree277923f77c84db0913308dff67bab53e474f8f5e
parent62597fdf961298fe4ca110932e7a62c0729e533d (diff)
parent60478685e72a0bedb740f1f7a5322f3a1bb5e59d (diff)
Merge pull request #3046 from nathanielmanistaatgoogle/defect
Use a custom exception in test_control
-rw-r--r--src/python/grpcio_test/grpc_test/framework/common/test_control.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/python/grpcio_test/grpc_test/framework/common/test_control.py b/src/python/grpcio_test/grpc_test/framework/common/test_control.py
index 3960c4e649..8d6eba5c2c 100644
--- a/src/python/grpcio_test/grpc_test/framework/common/test_control.py
+++ b/src/python/grpcio_test/grpc_test/framework/common/test_control.py
@@ -34,6 +34,14 @@ import contextlib
import threading
+class Defect(Exception):
+ """Simulates a programming defect raised into in a system under test.
+
+ Use of a standard exception type is too easily misconstrued as an actual
+ defect in either the test infrastructure or the system under test.
+ """
+
+
class Control(object):
"""An object that accepts program control from a system under test.
@@ -62,7 +70,7 @@ class PauseFailControl(Control):
def control(self):
with self._condition:
if self._fail:
- raise ValueError()
+ raise Defect()
while self._paused:
self._condition.wait()