Download:
child 40:8f08809cc1ce
parent 38:4326af080387
39:81920cb8753b
Anton Shestakov <av6@dwimlabs.net>, Sat, 18 Jun 2016 22:45:43 +0800
tests: create the in-memory database once in setup_module() Also mock the correct method, close() instead of disconnect().

1 файлов изменено, 9 вставок(+), 6 удалений(-) [+]
tests/test_viewer.py file | annotate | diff | comparison | revisions
--- a/tests/test_viewer.py Sat Jun 18 22:30:42 2016 +0800
+++ b/tests/test_viewer.py Sat Jun 18 22:45:43 2016 +0800
@@ -5,14 +5,17 @@
from viewer import CandolintViewer
+def setup_module():
+ database.init(':memory:')
+ database.connect()
+ database.create_tables([Project, Change, Check], safe=True)
+ database.init = Mock()
+ database.connect = Mock()
+ database.close = Mock()
+
+
class ViewerTestCase(AsyncHTTPTestCase):
def get_app(self):
- database.init(':memory:')
- database.connect()
- database.create_tables([Project, Change, Check], safe=True)
- database.init = Mock()
- database.connect = Mock()
- database.disconnect = Mock()
return CandolintViewer()
def test_index(self):