Skip to content

Commit

Permalink
removed all the prints from testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Anupam authored and Anupam committed Jul 14, 2023
1 parent 8d48250 commit 7f606c3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/sql/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ def database_ready(
try:
eng = sqlalchemy.create_engine(_get_database_url(database)).connect()
eng.close()
display.message_success(f"{database} is initialized successfully")
print(f"{database} is initialized successfully")
return True
except Exception as e:
display.message(type(e))
print(type(e))
errors.append(str(e))

time.sleep(poll_freq)

# print all the errors so we know what's going on since failing to connect might be
# to some misconfiguration error
errors_ = "\n".join(errors)
display.message(f"ERRORS: {errors_}")
print(f"ERRORS: {errors_}")

return True

Expand All @@ -219,7 +219,7 @@ def postgres(is_bypass_init=False):
container = client.containers.get(db_config["docker_ct"]["name"])
yield container
except errors.NotFound:
display.message("Creating new container: postgreSQL")
print("Creating new container: postgreSQL")
with new_container(
new_container_name=db_config["docker_ct"]["name"],
image_name=db_config["docker_ct"]["image"],
Expand Down Expand Up @@ -251,7 +251,7 @@ def mysql(is_bypass_init=False):
container = client.containers.get(db_config["docker_ct"]["name"])
yield container
except errors.NotFound:
display.message("Creating new container: mysql")
print("Creating new container: mysql")
with new_container(
new_container_name=db_config["docker_ct"]["name"],
image_name=db_config["docker_ct"]["image"],
Expand Down Expand Up @@ -291,7 +291,7 @@ def mariadb(is_bypass_init=False):
curr = client.containers.get(db_config["docker_ct"]["name"])
yield curr
except errors.NotFound:
display.message("Creating new container: mariaDB")
print("Creating new container: mariaDB")
with new_container(
new_container_name=db_config["docker_ct"]["name"],
image_name=db_config["docker_ct"]["image"],
Expand Down Expand Up @@ -331,7 +331,7 @@ def mssql(is_bypass_init=False):
curr = client.containers.get(db_config["docker_ct"]["name"])
yield curr
except errors.NotFound:
display.message("Creating new container: MSSQL")
print("Creating new container: MSSQL")
with new_container(
new_container_name=db_config["docker_ct"]["name"],
image_name=db_config["docker_ct"]["image"],
Expand Down Expand Up @@ -364,7 +364,7 @@ def oracle(is_bypass_init=False):
curr = client.containers.get(db_config["docker_ct"]["name"])
yield curr
except errors.NotFound:
display.message("Creating new container: oracle")
print("Creating new container: oracle")
with new_container(
new_container_name=db_config["docker_ct"]["name"],
image_name=db_config["docker_ct"]["image"],
Expand All @@ -381,14 +381,14 @@ def oracle(is_bypass_init=False):


def main():
display.message("Starting test containers...")
print("Starting test containers...")
with postgres(), mysql(), mariadb(), mssql(), oracle():
display.message("Press CTRL+C to exit")
print("Press CTRL+C to exit")
try:
while True:
time.sleep(5)
except KeyboardInterrupt:
display.message("Exit, containers will be killed")
print("Exit, containers will be killed")
sys.exit()


Expand Down

0 comments on commit 7f606c3

Please sign in to comment.