Flake8 Test Compliance

This commit is contained in:
Carson Woods
2019-07-18 15:50:19 -06:00
parent 9ab7d8f01d
commit b4c7520dd8
4 changed files with 45 additions and 3 deletions

View File

@@ -283,7 +283,8 @@ def do_uninstall(env, specs, force):
scope='user')
spack.config.set('config:active_upstream', None,
scope='user')
scope='user')
def get_uninstall_list(args, specs, env):
# Gets the list of installed specs that match the ones give via cli

View File

@@ -225,7 +225,8 @@ def root_path(name):
if active_upstream:
root_name = 'upstreams:' + active_upstream + ":modules:" + name
path = spack.config.get(root_name, os.path.join(spack.paths.share_path, name))
path = spack.config.get(root_name, os.path.join(spack.paths.share_path,
name))
else:
path = roots.get(name, os.path.join(spack.paths.share_path, name))

View File

@@ -1497,7 +1497,7 @@ def do_install(self, **kwargs):
# Install Package to Global Upstream for multi-user use
if install_global:
spack.config.set('config:active_upstream', 'global',
scope='user')
scope='user')
global_root = spack.config.get('upstreams')
global_root = global_root['global']['install_tree']
global_root = spack.util.path.canonicalize_path(global_root)

View File

@@ -60,6 +60,46 @@ def test_install_package_and_dependency(
assert 'errors="0"' in content
def test_global_install_package_and_dependency(
tmpdir, mock_packages, mock_archive, mock_fetch, config,
install_mockery):
with tmpdir.as_cwd():
install('--global',
'--log-format=junit',
'--log-file=test.xml',
'libdwarf')
files = tmpdir.listdir()
filename = tmpdir.join('test.xml')
assert filename in files
content = filename.open().read()
assert 'tests="2"' in content
assert 'failures="0"' in content
assert 'errors="0"' in content
def test_upstream_install_package_and_dependency(
tmpdir, mock_packages, mock_archive, mock_fetch, config,
install_mockery):
with tmpdir.as_cwd():
install('--upstream global',
'--log-format=junit',
'--log-file=test.xml',
'libdwarf')
files = tmpdir.listdir()
filename = tmpdir.join('test.xml')
assert filename in files
content = filename.open().read()
assert 'tests="2"' in content
assert 'failures="0"' in content
assert 'errors="0"' in content
@pytest.mark.disable_clean_stage_check
def test_install_runtests_notests(monkeypatch, mock_packages, install_mockery):
def check(pkg):