예제 #1
0
 def tearDown(self):
     # Clean up the loop we created in set up.
     # Call this after the instance tear down just in case it uses the loop
     reset_manager()
     loop = ioloop.IOLoop.current()
     if not loop._closing:  # pylint: disable=protected-access,no-member
         loop.close()
예제 #2
0
 def tearDown(self):
     self.__backend_instance.tearDown_method()
     # Clean up the loop we created in set up.
     # Call this after the instance tear down just in case it uses the loop
     reset_manager()
     loop = ioloop.IOLoop.current()
     if not loop._closing:
         loop.close()
예제 #3
0
    def clean_db(cls):
        """Clean up database and reset caches.

        Resets AiiDA manager cache, which could otherwise be left in an inconsistent state when cleaning the database.
        """
        from aiida.common.exceptions import InvalidOperation

        # Note: this will raise an exception, that will be seen as a test
        # failure. To be safe, you should do the same check also in the tearDownClass
        # to avoid that it is run
        check_if_tests_can_run()

        if not cls._class_was_setup:
            raise InvalidOperation('You cannot call clean_db before running the setUpClass')

        cls.__backend_instance.clean_db()

        reset_manager()
예제 #4
0
 def reset_db(self):
     self._test_case.clean_db()  # will drop all users
     manager.reset_manager()
     self.init_db()
예제 #5
0
 def tearDown(self):
     reset_manager()