/usr/lib/python3/dist-packages/invocations/testing.py is in python3-invocations 0.6.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 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",
'pty': "Whether to run tests under a pseudo-tty",
})
def test(ctx, module=None, runner=None, opts=None, pty=True):
"""
Run a Spec or Nose-powered internal test suite.
"""
runner = runner or 'spec'
# Allow selecting specific submodule
specific_module = " --tests=tests/%s.py" % module
args = (specific_module if module else "")
if opts:
args += " " + opts
# Use pty by default so the spec/nose/Python process buffers "correctly"
ctx.run(runner + args, pty=pty)
|