From 75e193dda027568ef7bf178da4ff2565e0b0dea1 Mon Sep 17 00:00:00 2001 From: Kartik Ohri Date: Fri, 1 Dec 2023 02:28:37 +0530 Subject: [PATCH] Test Improvements - 2 Remove unmaintained flask testing library and improve tests speed by clearing tables instead of dropping and recreating them between each test. These changes also help in upgrading the other flask dependencies. --- critiquebrainz/data/testing.py | 25 +++---------------- .../frontend/views/test/test_bb_author.py | 1 + 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/critiquebrainz/data/testing.py b/critiquebrainz/data/testing.py index b4d7c742a..633eb4d6b 100644 --- a/critiquebrainz/data/testing.py +++ b/critiquebrainz/data/testing.py @@ -1,24 +1,5 @@ -import os +from critiquebrainz.frontend.testing import FrontendTestCase -from flask_testing import TestCase -from critiquebrainz.data.utils import create_all, drop_tables, drop_types, clear_tables -from critiquebrainz.frontend import create_app - - -class DataTestCase(TestCase): - - def create_app(self): - app = create_app(config_path=os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'test_config.py')) - return app - - def setUp(self): - self.reset_db() - # TODO(roman): Add stuff form fixtures. - - def tearDown(self): - pass - - @staticmethod - def reset_db(): - clear_tables() +class DataTestCase(FrontendTestCase): + pass diff --git a/critiquebrainz/frontend/views/test/test_bb_author.py b/critiquebrainz/frontend/views/test/test_bb_author.py index c8e61a351..7dd487ceb 100644 --- a/critiquebrainz/frontend/views/test/test_bb_author.py +++ b/critiquebrainz/frontend/views/test/test_bb_author.py @@ -6,6 +6,7 @@ from critiquebrainz.db.user import User from critiquebrainz.frontend.testing import FrontendTestCase + class AuthorViewsTestCase(FrontendTestCase): def setUp(self):