def afterSetUp(self): super(TestTransactions,self).afterSetUp() self.app.txn_test_objectx = 0 transaction.commit() self.connected_to_mq = False try: self.pub = Publisher() self.connected_to_mq = True # start up message listener and wait for it to report "ready" localpath = os.path.dirname(__file__) listener_script = os.path.join(localpath, "listen_db_messages.py") listener = subprocess.Popen(["python",listener_script], bufsize=1, shell=False, stdout=subprocess.PIPE) listener.stdout.readline() self.listener = listener except Exception as e: log.warning( "failed to setup amqp connection: %s",e )