From 7e97e42066aa7a9011d6acad404f19bf14961b28 Mon Sep 17 00:00:00 2001 From: singuliere Date: Fri, 8 Feb 2019 11:44:53 +0100 Subject: [PATCH] allow overriding pytest functional arguments with posargs It is useful to run a single test from the command line with, for instance: tox -e ansibledevel-functional -- -k 'test_command_init_role[docker]' test/functional/test_command.py The test/functional/ pytest argument is made a default used when there are no posargs instead of being hardcoded and always used. If all pytest invocations include test/functional/ there is no way for the user to restrict the tests being run to a single file. Signed-off-by: singuliere --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8e0e38230..30932e68e 100644 --- a/tox.ini +++ b/tox.ini @@ -30,7 +30,7 @@ extras = vagrant commands = unit: pytest test/unit/ --cov={toxinidir}/molecule/ --no-cov-on-fail {posargs} - functional: pytest test/functional/ {posargs} + functional: pytest {posargs:test/functional/} lint: flake8 lint: yamllint -s test/ molecule/