From ef3244b31a61780ac9f2612c15326bc97145ef95 Mon Sep 17 00:00:00 2001 From: Tom Powell Date: Sun, 28 Oct 2018 18:50:54 -0700 Subject: [PATCH] make tests silent-er --- test.py | 10 +++++++--- ui/config.py | 1 + ui/gitlab/webhooks.py | 1 - 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test.py b/test.py index 8f9ddab..ea4b189 100644 --- 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 diff --git a/ui/config.py b/ui/config.py index 2657aab..523ea16 100644 --- a/ui/config.py +++ b/ui/config.py @@ -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") diff --git a/ui/gitlab/webhooks.py b/ui/gitlab/webhooks.py index 4c4461d..13e3b3f 100644 --- a/ui/gitlab/webhooks.py +++ b/ui/gitlab/webhooks.py @@ -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: -- 2.20.1