def connection(): connection = Connection(password='******', db_name='test') connection.drop_db() connection.connect() yield connection connection.drop_db()
def __init__(self, connection: Connection): self.connection = connection.connect() print('Connected to database Successfully') self.cursor = self.connection.cursor()