Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: mojo/python/tests/mojo_unittest.py

Issue 761553003: Add validation tests to python bindings. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/python/tests/mojo_unittest.py
diff --git a/mojo/python/tests/mojo_unittest.py b/mojo/python/tests/mojo_unittest.py
index 101f19c74aa1c3aeb3ff68caf6d5f06a4c3d05ce..f80ffacf1972d1496fa049b0d20d7dcbc1095655 100644
--- a/mojo/python/tests/mojo_unittest.py
+++ b/mojo/python/tests/mojo_unittest.py
@@ -10,11 +10,15 @@ import mojo.system
class MojoTestCase(unittest.TestCase):
-
- def setUp(self):
- mojo.embedder.Init()
- self.loop = mojo.system.RunLoop()
-
- def tearDown(self):
+ def __init__(self, *args, **kwargs):
+ unittest.TestCase.__init__(self, *args, **kwargs)
self.loop = None
- assert mojo.embedder.ShutdownForTest()
+
+ def run(self, *args, **kwargs):
+ try:
+ mojo.embedder.Init()
+ self.loop = mojo.system.RunLoop()
+ unittest.TestCase.run(self, *args, **kwargs)
+ finally:
+ self.loop = None
+ assert mojo.embedder.ShutdownForTest()
« no previous file with comments | « mojo/python/tests/bindings_serialization_deserialization_unittest.py ('k') | mojo/python/tests/validation_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698