--- a/run-tests.py Fri Jul 08 00:11:51 2016 +0800
+++ b/run-tests.py Fri Jul 08 00:15:17 2016 +0800
+from candolint.models import database, Project, Change, Check
+ database.init(':memory:')
+ database.create_tables([Project, Change, Check], safe=True)
+ database.connect = Mock()
+ database.close = Mock()
pytest.main(['tests'] + sys.argv[1:])
--- a/tests/test_viewer.py Fri Jul 08 00:11:51 2016 +0800
+++ b/tests/test_viewer.py Fri Jul 08 00:15:17 2016 +0800
from pytest import raises
from tornado.web import HTTPError
from tornado.testing import AsyncHTTPTestCase
from candolint.handlers import get_project_or_404
-from candolint.models import database, Project, Change, Check
+from candolint.models import database, Project
from viewer import CandolintViewer
- database.init(':memory:')
- database.create_tables([Project, Change, Check], safe=True)
- database.connect = Mock()
- database.close = Mock()
with database.transaction():
url='https://example.com/alice/test-viewer',