diff --git a/tests/helper/config_helper.py b/tests/helper/config_helper.py index d2f5ac9..908602a 100644 --- a/tests/helper/config_helper.py +++ b/tests/helper/config_helper.py @@ -45,3 +45,25 @@ def remove(self): os.remove(self._get_filepath()) except Exception as e: print(e) + + +def create_config(level="INFO"): + config = JsonConfigGenerator( + sqldirectory="/A/C/Desktop/views", + file_extension="sql", + strategy="sqllite", + Snowflake_Account={ + "user": "user", + "password": "password", + "account": "account", + "database": "database", + "schema": "schema", + "warehouse": "warehouse", + }, + logging={ + "format": '[%(asctime)s] [%(processName)-10s] [%(name)s] ' + '[%(levelname)s] -> %(message)s', + "level": f"{level}", + } + ) + return config diff --git a/tests/run_all.py b/tests/run_all.py index 35af505..16e79d4 100644 --- a/tests/run_all.py +++ b/tests/run_all.py @@ -21,14 +21,21 @@ # SOFTWARE. import unittest +from tests.helper.config_helper import create_config def parsesql_test_suite(): """Test suite for parsesql tests""" + create_config().create() test_loader = unittest.TestLoader() test_suite = test_loader.discover('.') return test_suite if __name__ == "__main__": - unittest.TextTestRunner(verbosity=2).run(parsesql_test_suite()) + result = unittest.TextTestRunner(verbosity=2).run(parsesql_test_suite()) + + if result.wasSuccessful(): + exit(0) + else: + exit(1)