old_contents: import os
  
  from invoke import run, task
  
  
  @task
  def test(speed='fast'):
      if speed == 'fast':
          os.environ['DATABASE_URL'] = "sqlite://"
      run("coverage run manage.py test")
      run("coverage html")
  
new_contents: import os
  
  from invoke import run, task
  
  
  @task
  def test(speed='fast'):
      if speed == 'fast':
          os.environ['DATABASE_URL'] = "sqlite://"
      run("py.test")
  
subject: Use py.test for running tests in invoke tasks file