forked from platformio/platformio-core
PlatformIO Library Manager 3.0 // Resolve #588 , Resolve #414, Resolve #498, Resolve #475, Resolve #410, Resolve #461, Resolve #361, Resolve #507, Resolve #554
This commit is contained in:
1 parent
5b5a63cb5f
commit
758396c9ea
34 files changed
+1185
-700
No files matched your search
+19
-8
@@ -1,4 +1,4 @@
|
||||
# Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
|
||||
# Copyright 2014-present Ivan Kravets <me@ikravets.com>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -12,29 +12,28 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from os import environ
|
||||
|
||||
from click.testing import CliRunner
|
||||
import os
|
||||
|
||||
import pytest
|
||||
from click.testing import CliRunner
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def platformio_setup(request):
|
||||
pioenvvars = ("ENABLE_PROMPTS", "ENABLE_TELEMETRY")
|
||||
for v in pioenvvars:
|
||||
environ["PLATFORMIO_SETTING_%s" % v] = "No"
|
||||
os.environ["PLATFORMIO_SETTING_%s" % v] = "No"
|
||||
|
||||
def platformio_teardown():
|
||||
for v in pioenvvars:
|
||||
_name = "PLATFORMIO_SETTING_%s" % v
|
||||
if _name in environ:
|
||||
del environ[_name]
|
||||
if _name in os.environ:
|
||||
del os.environ[_name]
|
||||
|
||||
request.addfinalizer(platformio_teardown)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="module")
|
||||
def clirunner():
|
||||
return CliRunner()
|
||||
|
||||
@@ -46,3 +45,15 @@ def validate_cliresult():
|
||||
assert not result.exception
|
||||
assert "error" not in result.output.lower()
|
||||
return decorator
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def isolated_pio_home(request, tmpdir_factory):
|
||||
home_dir = tmpdir_factory.mktemp(".platformio")
|
||||
os.environ['PLATFORMIO_HOME_DIR'] = str(home_dir)
|
||||
|
||||
def fin():
|
||||
del os.environ['PLATFORMIO_HOME_DIR']
|
||||
|
||||
request.addfinalizer(fin)
|
||||
return home_dir
|
||||
Reference in new issue
Block a user