summaryrefslogtreecommitdiff
path: root/lib/spack/spack/test/cmd/location.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/test/cmd/location.py')
-rw-r--r--lib/spack/spack/test/cmd/location.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/spack/spack/test/cmd/location.py b/lib/spack/spack/test/cmd/location.py
index 8d8d4fc5bf..fe73607a18 100644
--- a/lib/spack/spack/test/cmd/location.py
+++ b/lib/spack/spack/test/cmd/location.py
@@ -17,8 +17,9 @@ import spack.stage
from spack.main import SpackCommand, SpackCommandError
# Everything here uses (or can use) the mock config and database.
-pytestmark = pytest.mark.usefixtures('config', 'database')
-
+pytestmark = [pytest.mark.usefixtures('config', 'database'),
+ pytest.mark.skipif(sys.platform == "win32",
+ reason="does not run on windows")]
# location prints out "locations of packages and spack directories"
location = SpackCommand('location')
env = SpackCommand('env')
@@ -38,14 +39,12 @@ def mock_spec():
shutil.rmtree(pkg.stage.path)
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
def test_location_build_dir(mock_spec):
"""Tests spack location --build-dir."""
spec, pkg = mock_spec
assert location('--build-dir', spec.name).strip() == pkg.stage.source_path
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
@pytest.mark.regression('22738')
def test_location_source_dir(mock_spec):
"""Tests spack location --source-dir."""
@@ -54,7 +53,6 @@ def test_location_source_dir(mock_spec):
assert location(spec.name).strip() == pkg.stage.source_path
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
def test_location_source_dir_missing():
"""Tests spack location --source-dir with a missing source directory."""
spec = 'mpileaks'
@@ -65,7 +63,6 @@ def test_location_source_dir_missing():
assert out == expected
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
@pytest.mark.parametrize('options', [([]),
(['--source-dir', 'mpileaks']),
(['--env', 'missing-env']),
@@ -76,7 +73,6 @@ def test_location_cmd_error(options):
location(*options)
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
def test_location_env_exists(mutable_mock_env_path):
"""Tests spack location --env <name> for an existing environment."""
e = ev.create("example")
@@ -84,7 +80,6 @@ def test_location_env_exists(mutable_mock_env_path):
assert location('--env', "example").strip() == e.path
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
def test_location_with_active_env(mutable_mock_env_path):
"""Tests spack location --env with active env"""
e = ev.create("example")
@@ -93,7 +88,6 @@ def test_location_with_active_env(mutable_mock_env_path):
assert location('--env').strip() == e.path
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
def test_location_env_flag_interference(mutable_mock_env_path, tmpdir):
"""
Tests that specifying an active environment using `spack -e x location ...`
@@ -115,7 +109,6 @@ def test_location_env_flag_interference(mutable_mock_env_path, tmpdir):
assert 'first_env' not in location('--packages', global_args=global_args)
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
def test_location_env_missing():
"""Tests spack location --env."""
missing_env_name = 'missing-env'
@@ -124,7 +117,6 @@ def test_location_env_missing():
assert out == error
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
@pytest.mark.db
def test_location_install_dir(mock_spec):
"""Tests spack location --install-dir."""
@@ -132,7 +124,6 @@ def test_location_install_dir(mock_spec):
assert location('--install-dir', spec.name).strip() == spec.prefix
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
@pytest.mark.db
def test_location_package_dir(mock_spec):
"""Tests spack location --package-dir."""
@@ -140,7 +131,6 @@ def test_location_package_dir(mock_spec):
assert location('--package-dir', spec.name).strip() == pkg.package_dir
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
@pytest.mark.db
@pytest.mark.parametrize('option,expected', [
('--module-dir', spack.paths.module_path),
@@ -151,7 +141,6 @@ def test_location_paths_options(option, expected):
assert location(option).strip() == expected
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
@pytest.mark.parametrize('specs,expected', [
([], "You must supply a spec."),
(['spec1', 'spec2'], "Too many specs. Supply only one.")])
@@ -161,7 +150,6 @@ def test_location_spec_errors(specs, expected):
assert location(*specs, fail_on_error=False).strip() == error
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
@pytest.mark.db
def test_location_stage_dir(mock_spec):
"""Tests spack location --stage-dir."""
@@ -169,7 +157,6 @@ def test_location_stage_dir(mock_spec):
assert location('--stage-dir', spec.name).strip() == pkg.stage.path
-@pytest.mark.skipif(sys.platform == 'win32', reason="Error on Win")
@pytest.mark.db
def test_location_stages(mock_spec):
"""Tests spack location --stages."""