Use exceptions instead of printing to stdout. Part of an effort to convert Python tests to python 3 syntax.
19 lines
261 B
Python
19 lines
261 B
Python
from director_thread import Foo
|
|
|
|
|
|
class Derived(Foo):
|
|
|
|
def __init__(self):
|
|
Foo.__init__(self)
|
|
|
|
def do_foo(self):
|
|
self.val = self.val - 1
|
|
|
|
|
|
d = Derived()
|
|
d.run()
|
|
|
|
if d.val >= 0:
|
|
raise RuntimeError("d.val: {}".format(d.val))
|
|
|
|
d.stop()
|