input: Write a Python function to fetch JSON data from a given URL and return a list of items.
  assert fetch_data('https://jsonplaceholder.typicode.com/posts') != []
  assert isinstance(fetch_data('https://jsonplaceholder.typicode.com/posts'), list)
  assert isinstance(fetch_data('https://jsonplaceholder.typicode.com/posts')[0], dict)
output: import requests
  
  def fetch_data(url):
      response = requests.get(url)
      response.raise_for_status()  # This will raise an HTTPError if the HTTP request returned an unsuccessful status code
      return response.json()