Example #1
0
    def teardown_class(self):
        """
        This method tears down the testing logic to ensure that no data remains after testing that shouldn't. In this
        case, it closes the database session.
        """
        with transaction.manager:
            for run in DBSession.query(Run).all():
                # Delete every run in the session.
                DBSession.delete(run)
            DBSession.commit()

        # Close the session.
        DBSession.remove()
        testing.tearDown()
Example #2
0
    def teardown_class(self):
        """
        This method tears down the class after testing has been completed, in order to ensure no data exists after
        testing that shouldn't. In this case, closes down the database session.
        """
        with transaction.manager:
            for run in DBSession.query(Run).all():
                # Delete all runs in the database.
                DBSession.delete(run)
            DBSession.commit()

        # Close the database session.
        DBSession.remove()
        testing.tearDown()
Example #3
0
 def teardown_class(self):
     """
     This method tears down the testing class, closing the database session once the class is redundant.
     """
     DBSession.remove()
     testing.tearDown()
Example #4
0
 def teardown_class(self):
     '''
     Closes database session once the class is redundant
     '''
     DBSession.remove()
     testing.tearDown()