
import subprocess
from invoke import task


@task
def test():
    # invoke.run() does not color output, unfortunately
    nosetests = subprocess.Popen(['nosetests', '--rednose'])
    nosetests.wait()


@task
def cover():
    nosetests = subprocess.Popen(['nosetests', '--with-coverage',
                                  '--cover-erase', '--cover-html'])
    nosetests.wait()


import os
import subprocess
from invoke import task


@task
def test():
    # invoke.run() does not respect colored output, unfortunately
    nosetests = subprocess.Popen(['nosetests', '--rednose'])
    nosetests.wait()


@task
def cover():
    try:
        os.mkdir('cover')
    except OSError:
        pass
    nosetests = subprocess.Popen(['nosetests', '--with-coverage',
                                  '--cover-erase', '--cover-html'])
    nosetests.wait()

Fix bug that raised error when generating coverage
Fix bug that raised error when generating coverage

  
+ import os
  import subprocess
  from invoke import task
  
  
  @task
  def test():
-     # invoke.run() does not color output, unfortunately
+     # invoke.run() does not respect colored output, unfortunately
      nosetests = subprocess.Popen(['nosetests', '--rednose'])
      nosetests.wait()
  
  
  @task
  def cover():
+     try:
+         os.mkdir('cover')
+     except OSError:
+         pass
      nosetests = subprocess.Popen(['nosetests', '--with-coverage',
                                    '--cover-erase', '--cover-html'])
      nosetests.wait()
  
Fix bug that raised error when generating coverage
## Code Before:

import subprocess
from invoke import task


@task
def test():
    # invoke.run() does not color output, unfortunately
    nosetests = subprocess.Popen(['nosetests', '--rednose'])
    nosetests.wait()


@task
def cover():
    nosetests = subprocess.Popen(['nosetests', '--with-coverage',
                                  '--cover-erase', '--cover-html'])
    nosetests.wait()

## Instruction:
Fix bug that raised error when generating coverage
## Code After:

import os
import subprocess
from invoke import task


@task
def test():
    # invoke.run() does not respect colored output, unfortunately
    nosetests = subprocess.Popen(['nosetests', '--rednose'])
    nosetests.wait()


@task
def cover():
    try:
        os.mkdir('cover')
    except OSError:
        pass
    nosetests = subprocess.Popen(['nosetests', '--with-coverage',
                                  '--cover-erase', '--cover-html'])
    nosetests.wait()
