Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@tox.hookimpl
def tox_runtest_pre(self):
log.append("started")
@tox.hookimpl
def tox_testenv_install_deps(self, action, venv):
assert isinstance(action, tox.session.Action)
assert isinstance(venv, VirtualEnv)
log.append(2)
@tox.hookimpl
def tox_runtest_post(self):
log.append("finished")
@tox.hookimpl
def tox_runtest(venv, redirect):
venv.test(redirect=redirect)
return True # Return non-None to indicate plugin has completed
@tox.hookimpl
def tox_configure(config):
"""Check for the presence of the added options."""
if 'TRAVIS' not in os.environ:
return
ini = config._cfg
# envlist
if 'TOXENV' not in os.environ and not config.option.env:
envlist = detect_envlist(ini)
undeclared = set(envlist) - set(config.envconfigs)
if undeclared:
print('Matching undeclared envs is deprecated. Be sure all the '
'envs that Tox should run are declared in the tox config.',
file=sys.stderr)
autogen_envconfigs(config, undeclared)
@tox.hookimpl
def tox_package(session, venv):
"""Build an sdist at first call return that for all calls"""
if not hasattr(session, "package"):
session.package, session.dist = get_package(session)
return session.package
@tox_hookimpl
def tox_get_python_executable(envconfig):
"""Return a python executable for the given python base name.
The first plugin/hook which returns an executable path will determine it.
``envconfig`` is the testenv configuration which contains
per-testenv configuration, notably the ``.envname`` and ``.basepython``
setting.
"""
try:
# pylint: disable=no-member
pyenv = (getattr(py.path.local.sysfind('pyenv'), 'strpath', 'pyenv')
or 'pyenv')
cmd = [pyenv, 'which', envconfig.basepython]
pipe = subprocess.Popen(
cmd,
@hookimpl
def tox_addoption(parser):
# necessary to allow the docker= directive in testenv sections
parser.add_testenv_attribute(
name="docker",
type="line-list",
help="Name of docker images, including tag, to start before the test run",
default=[],
)
# command line flag to keep docker containers running
parser.add_argument(
"--docker-dont-stop",
default=[],
action="append",
metavar="CONTAINER",
help=(
@hookimpl
def tox_addoption(parser):
parser.add_argument(
'--exclude', metavar='REGEX', default=None,
help="Exclude files matching REGEX from being watched")
@hookimpl
def tox_addoption(parser):
parser.add_argument(
'-w', '--watch',
action='append',
help="Watch a folder for changes and rebuild when detected file changes/new files")