input: 
  from flask import Flask, jsonify
  import sqlite3
  
  def fetch_data_from_sql():
      """ This function fetches data from an SQL database and presents the data in the form of JSON.
      >>> app = fetch_data_from_sql()
      >>> app._called_context_names
      ['getitem', 'iter_contexts']
      """
      app = Flask(__name__)
      
      def dict_factory(cursor, row):
          d = {}
          for idx, col in enumerate(cursor.description):
              d[col[0]] = row[idx]
          return d
      
      @app.route('/', methods=['GET'])
      def index():
          connection = sqlite3.connect('database.db')
          connection.row_factory = dict_factory
          cur = connection.cursor()
          all_users = cur.execute('SELECT * FROM users;').fetchall()
          return jsonify(all_users)
      
      if __name__ == '__main__':
          app.run(debug=True)
      
      return app
  
output:     app.testing = True
      with app.test_client() as client:
          response = client.get('/')
          assert response.status_code == 200
          assert isinstance(response.json, list)
          for user in response.json:
              assert isinstance(user, dict)
              assert 'id' in user
              assert 'name' in user
              assert 'email' in user