make tests silent-er
authorTom Powell <tom@powell.io>
Mon, 29 Oct 2018 01:50:54 +0000 (18:50 -0700)
committerTom Powell <tom@powell.io>
Mon, 29 Oct 2018 01:50:54 +0000 (18:50 -0700)
test.py
ui/config.py
ui/gitlab/webhooks.py

diff --git a/test.py b/test.py
index 8f9ddabfc82ec14864b3b778f2205ed34d68b54d..ea4b18985188781b8aacecd1cecd84c9ed5ac8c2 100644 (file)
--- a/test.py
+++ b/test.py
@@ -1,6 +1,9 @@
+import contextlib
 import datetime
 import os
+import sys
 import unittest
+
 import flask_migrate
 import flask_testing
 
@@ -14,10 +17,12 @@ class UsesApp(flask_testing.TestCase):
 
 class UsesModels(UsesApp):
     def setUp(self):
-        flask_migrate.upgrade(revision="head")
+        with open(os.devnull, "w") as f, contextlib.redirect_stderr(f):
+            flask_migrate.upgrade(revision="head")
 
     def tearDown(self):
-        flask_migrate.downgrade(revision="base")
+        with open(os.devnull, "w") as f, contextlib.redirect_stderr(f):
+            flask_migrate.downgrade(revision="base")
 
 class TestModels(UsesModels):
 
@@ -85,7 +90,6 @@ class TestWebhooks(UsesModels):
         assert build.build_runner.runner_name == "phenom-test"
         assert build.build_version == "lineage-15.1"
         assert build.build_device == "FAKE_TEST"
-        print(build.build_status)
         assert build.build_status == "success"
         assert build.build_duration == 81
 
index 2657aab3905cd5aa937e8fd668a01de34d32954a..523ea16ff84bc95ab686cdc414948358c3165bc8 100644 (file)
@@ -1,6 +1,7 @@
 import os
 
 SQLALCHEMY_DATABASE_URI = os.environ.get("SQLALCHEMY_DATABASE_URI", 'sqlite:////tmp/ui.db')
+SQLALCHEMY_TRACK_MODIFICATIONS = False
 CACHE_TYPE = 'simple'
 
 GITLAB_WEBHOOK_TOKEN = os.environ.get("GITLAB_WEBHOOK_TOKEN", "secret")
index 4c4461dca42c91f4f3fe1e6d492e3be7e542c591..13e3b3f018f3896770481c7368e12a5814b40074 100644 (file)
@@ -28,7 +28,6 @@ def process(request):
             if stage.get('name') == 'build':
                 build_stage = stage
         runner = build_stage.get("runner")
-        print(type(runner))
         if runner:
             build.build_runner = Runner.get_or_create_by_id(runner.get('id'))
             if not build.build_runner.runner_name: