Esempio n. 1
0
def assert_query_count(num, ignore_txn=False):
    qh = QueryLogHandler()
    logger.setLevel(logging.DEBUG)
    logger.addHandler(qh)
    try:
        qc0 = len(qh.queries(ignore_txn=ignore_txn))
        yield qh
    finally:
        logger.removeHandler(qh)
        qc1 = len(qh.queries(ignore_txn=ignore_txn))
        assert (qc1 - qc0) == num
Esempio n. 2
0
 def setUp(self):
     self.qh = QueryLogHandler()
     logger.setLevel(logging.DEBUG)
     logger.addHandler(self.qh)
Esempio n. 3
0
 def setUp(self):
     self.qh = QueryLogHandler()
     logger.setLevel(logging.DEBUG)
     logger.addHandler(self.qh)