From 70031040b371a71933f45c30b4645386228cfff0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 16 Jul 2016 18:00:55 +0300 Subject: [PATCH] Rename test --ignore option to --skip --- docs/userguide/cmd_test.rst | 6 +++--- platformio/commands/test.py | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/userguide/cmd_test.rst b/docs/userguide/cmd_test.rst index af38f9b7..1a4dba6c 100644 --- a/docs/userguide/cmd_test.rst +++ b/docs/userguide/cmd_test.rst @@ -43,9 +43,9 @@ Options Process specified environments. More details :option:`platformio run --environment` .. option:: - -i, --ignore + --skip -Ignore tests where the name matches with specified pattern. More than one +Skip over tests where the name matches specified patterns. More than one option/pattern is allowed. .. list-table:: @@ -66,7 +66,7 @@ option/pattern is allowed. * - ``[!seq]`` - matches any character not in seq -For example, ``platformio test --ignore "mytest*" -i "test[13]"`` +For example, ``platformio test --skip "mytest*" -i "test[13]"`` .. option:: --upload-port diff --git a/platformio/commands/test.py b/platformio/commands/test.py index 0769f7f7..0585a0b1 100644 --- a/platformio/commands/test.py +++ b/platformio/commands/test.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +# pylint: disable=R0913,R0914 + from fnmatch import fnmatch from os import getcwd, listdir from os.path import isdir, join @@ -28,15 +30,14 @@ from platformio.managers.platform import PlatformFactory @click.command("test", short_help="Unit Testing") @click.option("--environment", "-e", multiple=True, metavar="") -@click.option("--ignore", "-i", multiple=True, metavar="") +@click.option("--skip", multiple=True, metavar="") @click.option("--upload-port", metavar="") @click.option("--project-dir", "-d", default=getcwd, type=click.Path(exists=True, file_okay=False, dir_okay=True, writable=True, resolve_path=True)) @click.option("--verbose", "-v", count=True, default=3) @click.pass_context -def cli(ctx, environment, ignore, upload_port, # pylint: disable=R0913,R0914 - project_dir, verbose): +def cli(ctx, environment, skip, upload_port, project_dir, verbose): assert check_project_envs(project_dir, environment) with util.cd(project_dir): test_dir = util.get_projecttest_dir() @@ -58,8 +59,8 @@ def cli(ctx, environment, ignore, upload_port, # pylint: disable=R0913,R0914 if environment and envname not in environment: continue - # check ignore patterns - if testname != "*" and any([fnmatch(testname, i) for i in ignore]): + # check skip patterns + if testname != "*" and any([fnmatch(testname, p) for p in skip]): results.append((None, testname, envname)) continue @@ -133,7 +134,8 @@ class TestProcessor(object): return self.cmd_ctx.invoke( cmd_run, project_dir=self.options['project_dir'], upload_port=self.options['upload_port'], - verbose=self.options['verbose'], environment=[self.env_name], + verbose=self.options['verbose'], + environment=[self.env_name], target=target )