def assertNumQueries(self, num, func=None):

        context = QueriesContext(num, self)
        if func is None:
            return context

        with context:
            func()
Check number of queries by flask_sqlalchemy.
dataset/ETHPy150Open klen/Flask-Foundation/base/core/tests.py/FlaskTest.assertNumQueries