From 9b2999d64b02cc65dc62434a29d0fe841b3d1886 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 2 Sep 2016 22:23:26 +0300 Subject: [PATCH] Fix test for "pio test" --- tests/commands/test_test.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/commands/test_test.py b/tests/commands/test_test.py index 1ecaac39..173f8113 100644 --- a/tests/commands/test_test.py +++ b/tests/commands/test_test.py @@ -14,13 +14,16 @@ from os.path import join -from platformio.commands.test import cli as cli_test +import pytest + +from platformio import util -def test_local_env(clirunner, validate_cliresult): - result = clirunner.invoke( - cli_test, - ["-d", join("examples", "unit-testing", "calculator"), "-e", "local"]) - validate_cliresult(result) +def test_local_env(): + result = util.exec_command(["platformio", "test", "-d", + join("examples", "unit-testing", "calculator"), + "-e", "local"]) + if result['returncode'] != 0: + pytest.fail(result) assert all( - [s in result.output for s in ("[PASSED]", "[IGNORED]", "[FAILED]")]) + [s in result['out'] for s in ("[PASSED]", "[IGNORED]", "[FAILED]")])