Skip to content
Snippets Groups Projects
Commit 9639b81a authored by Masood Malekghassemi's avatar Masood Malekghassemi
Browse files

Merge pull request #3046 from nathanielmanistaatgoogle/defect

Use a custom exception in test_control
parents 62597fdf 60478685
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment