Skip to content

Commit

Permalink
changed test handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dondaum committed Jan 6, 2020
1 parent bfdb3fc commit fdd413c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
22 changes: 22 additions & 0 deletions tests/helper/config_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 8 additions & 1 deletion tests/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit fdd413c

Please sign in to comment.