tests: test_config.py cosmetics

Trivial cleanups, no functional changes expected.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Marti Bolivar 2019-05-24 12:36:16 -06:00
parent a2ae763750
commit d2cb5d6109
1 changed files with 5 additions and 4 deletions

View File

@ -13,10 +13,13 @@
#
import os
import pytest
import subprocess
import pytest
from west import configuration as config
from west.util import canon_path
from conftest import cmd
@ -60,7 +63,6 @@ def test_config_global(west_init_tmpdir):
testkey_value = cmd('config pytest.testkey_global')
assert testkey_value.rstrip() == 'foo'
def test_config_local(west_init_tmpdir):
if not os.path.exists(os.path.expanduser('~')):
os.mkdir(os.path.expanduser('~'))
@ -105,13 +107,12 @@ def test_config_local(west_init_tmpdir):
testkey_value = cmd('config pytest.testkey_local')
assert testkey_value.rstrip() == 'foo2'
# We skip this test if executed directly using pytest, to avoid modifying
# user's real ~/.westconfig.
# We want to ensure HOME is pointing inside TOX temp dir before continuing.
@pytest.mark.skipif(os.environ.get('TOXTEMPDIR') is None,
reason="This test requires to be executed using tox")
def test_config_precendence(west_init_tmpdir):
def test_config_precedence(west_init_tmpdir):
if not os.path.exists(os.path.expanduser('~')):
os.mkdir(os.path.expanduser('~'))