diff --git a/platformio/commands/device.py b/platformio/commands/device.py index 594020eb..992ad9b2 100644 --- a/platformio/commands/device.py +++ b/platformio/commands/device.py @@ -163,6 +163,7 @@ def device_list( # pylint: disable=too-many-branches "--environment", help="Load configuration from `platformio.ini` and specified environment") def device_monitor(**kwargs): # pylint: disable=too-many-branches + env_options = {} try: env_options = get_project_options(kwargs['project_dir'], kwargs['environment']) diff --git a/platformio/commands/run/__init__.py b/platformio/commands/run/__init__.py index 05d4d370..b9e69521 100644 --- a/platformio/commands/run/__init__.py +++ b/platformio/commands/run/__init__.py @@ -13,3 +13,4 @@ # limitations under the License. from platformio.commands.run.command import cli +from platformio.commands.run.helpers import print_header diff --git a/tests/commands/test_init.py b/tests/commands/test_init.py index e8ad5547..7c2e4a48 100644 --- a/tests/commands/test_init.py +++ b/tests/commands/test_init.py @@ -110,11 +110,12 @@ def test_init_special_board(clirunner, validate_cliresult): config = ProjectConfig(join(getcwd(), "platformio.ini")) config.validate() - expected_result = [("platform", boards[0]['platform']), - ("board", "uno"), - ("framework", [boards[0]['frameworks'][0]])] + expected_result = dict(platform=str(boards[0]['platform']), + board="uno", + framework=[str(boards[0]['frameworks'][0])]) assert config.has_section("env:uno") - assert config.items("env:uno") == expected_result + assert sorted(config.items(env="uno", as_dict=True).items()) == sorted( + expected_result.items()) def test_init_enable_auto_uploading(clirunner, validate_cliresult): @@ -125,10 +126,13 @@ def test_init_enable_auto_uploading(clirunner, validate_cliresult): validate_pioproject(getcwd()) config = ProjectConfig(join(getcwd(), "platformio.ini")) config.validate() - expected_result = [("targets", ["upload"]), ("platform", "atmelavr"), - ("board", "uno"), ("framework", ["arduino"])] + expected_result = dict(targets=["upload"], + platform="atmelavr", + board="uno", + framework=["arduino"]) assert config.has_section("env:uno") - assert config.items("env:uno") == expected_result + assert sorted(config.items(env="uno", as_dict=True).items()) == sorted( + expected_result.items()) def test_init_custom_framework(clirunner, validate_cliresult): @@ -139,10 +143,13 @@ def test_init_custom_framework(clirunner, validate_cliresult): validate_pioproject(getcwd()) config = ProjectConfig(join(getcwd(), "platformio.ini")) config.validate() - expected_result = [("platform", "teensy"), ("board", "teensy31"), - ("framework", ["mbed"])] + expected_result = dict(platform="teensy", + board="teensy31", + framework=["mbed"]) assert config.has_section("env:teensy31") - assert config.items("env:teensy31") == expected_result + assert sorted(config.items(env="teensy31", + as_dict=True).items()) == sorted( + expected_result.items()) def test_init_incorrect_board(clirunner): diff --git a/tests/test_projectconf.py b/tests/test_projectconf.py index 69b6308b..8717e8da 100644 --- a/tests/test_projectconf.py +++ b/tests/test_projectconf.py @@ -172,6 +172,6 @@ def test_empty_config(): assert config.get("section", "option", 13) == 13 # sysenv - os.environ["PLATFORMIO_CORE_DIR"] = "/custom/core/dir" + os.environ["PLATFORMIO_HOME_DIR"] = "/custom/core/dir" assert config.get("platformio", "core_dir") == "/custom/core/dir" - del os.environ["PLATFORMIO_CORE_DIR"] + del os.environ["PLATFORMIO_HOME_DIR"]