from invoke import ctask as task


@task(help={
    'module': "Just runs tests/STRING.py.",
    'runner': "Use STRING to run tests instead of 'spec'."
})
def test(ctx, module=None, runner='spec'):
    """
    Run a Spec or Nose-powered internal test suite.
    """
    # Allow selecting specific submodule
    specific_module = " --tests=tests/%s.py" % module
    args = (specific_module if module else "")
    # Use pty so the spec/nose/Python process buffers "correctly"
    ctx.run(runner + args, pty=True)

from invoke import ctask as task


@task(help={
    'module': "Just runs tests/STRING.py.",
    'runner': "Use STRING to run tests instead of 'spec'.",
    'opts': "Extra flags for the test runner",
})
def test(ctx, module=None, runner='spec', opts=None):
    """
    Run a Spec or Nose-powered internal test suite.
    """
    # Allow selecting specific submodule
    specific_module = " --tests=tests/%s.py" % module
    args = (specific_module if module else "")
    if opts:
        args += " " + opts
    # Use pty so the spec/nose/Python process buffers "correctly"
    ctx.run(runner + args, pty=True)

Add flag passthrough for 'test'
Add flag passthrough for 'test'

  from invoke import ctask as task
  
  
  @task(help={
      'module': "Just runs tests/STRING.py.",
-     'runner': "Use STRING to run tests instead of 'spec'."
+     'runner': "Use STRING to run tests instead of 'spec'.",
+     'opts': "Extra flags for the test runner",
  })
- def test(ctx, module=None, runner='spec'):
+ def test(ctx, module=None, runner='spec', opts=None):
      """
      Run a Spec or Nose-powered internal test suite.
      """
      # Allow selecting specific submodule
      specific_module = " --tests=tests/%s.py" % module
      args = (specific_module if module else "")
+     if opts:
+         args += " " + opts
      # Use pty so the spec/nose/Python process buffers "correctly"
      ctx.run(runner + args, pty=True)
  
Add flag passthrough for 'test'
## Code Before:
from invoke import ctask as task


@task(help={
    'module': "Just runs tests/STRING.py.",
    'runner': "Use STRING to run tests instead of 'spec'."
})
def test(ctx, module=None, runner='spec'):
    """
    Run a Spec or Nose-powered internal test suite.
    """
    # Allow selecting specific submodule
    specific_module = " --tests=tests/%s.py" % module
    args = (specific_module if module else "")
    # Use pty so the spec/nose/Python process buffers "correctly"
    ctx.run(runner + args, pty=True)

## Instruction:
Add flag passthrough for 'test'
## Code After:
from invoke import ctask as task


@task(help={
    'module': "Just runs tests/STRING.py.",
    'runner': "Use STRING to run tests instead of 'spec'.",
    'opts': "Extra flags for the test runner",
})
def test(ctx, module=None, runner='spec', opts=None):
    """
    Run a Spec or Nose-powered internal test suite.
    """
    # Allow selecting specific submodule
    specific_module = " --tests=tests/%s.py" % module
    args = (specific_module if module else "")
    if opts:
        args += " " + opts
    # Use pty so the spec/nose/Python process buffers "correctly"
    ctx.run(runner + args, pty=True)
