Actortest: add teardown to avoid interference with other tests
@@ -239,6 +239,13 @@ def setup_calvinlib():
lib.set("base64", MockBase64())
lib.set("copy", MockCopy())
+def teardown_calvinlib():
+ import calvin.runtime.north.calvinlib as calvinlib
+ from calvin.runtime.north.calvinlib import TESTING
+ calvinlib.TESTING=False
+ del calvinlib._calvinlib
+ calvinlib._calvinlib=None
+
class ActorTester(object):
def __init__(self):
@@ -433,6 +440,8 @@ def test_actors(actor="", show=False, path=None):
if results['fail']:
raise Exception("%d actor(s) failed tests" % (len(results['fail']),))
+ teardown_calvinlib()
+
if __name__ == '__main__':
