diff options
author | Nicole C. <48625123+nicolecheetham@users.noreply.github.com> | 2024-09-05 16:34:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 15:34:19 -0500 |
commit | 434a703bcf2f8a41ffebbd1ede73e55bdd178893 (patch) | |
tree | c57ea87094acaf8a4a801f16b553d2b38a98e501 | |
parent | a42108438dee05140e785804a16699debb00e8ea (diff) | |
download | spack-434a703bcf2f8a41ffebbd1ede73e55bdd178893.tar.gz spack-434a703bcf2f8a41ffebbd1ede73e55bdd178893.tar.bz2 spack-434a703bcf2f8a41ffebbd1ede73e55bdd178893.tar.xz spack-434a703bcf2f8a41ffebbd1ede73e55bdd178893.zip |
Windows: Update pytest with echo and remove others (#45620)
* Windows: Update pytest with echo and remove others
* Fix style
* Remove unused pytest import in undevelop
* Update test_test_part_pass to be Window compatible
* Style
-rw-r--r-- | lib/spack/spack/test/cmd/develop.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/test/cmd/find.py | 1 | ||||
-rw-r--r-- | lib/spack/spack/test/cmd/gc.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/test/cmd/stage.py | 1 | ||||
-rw-r--r-- | lib/spack/spack/test/cmd/undevelop.py | 6 | ||||
-rw-r--r-- | lib/spack/spack/test/cmd/uninstall.py | 1 | ||||
-rw-r--r-- | lib/spack/spack/test/concretize_errors.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/test/concretize_requirements.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/test/container/cli.py | 1 | ||||
-rw-r--r-- | lib/spack/spack/test/package_class.py | 1 | ||||
-rw-r--r-- | lib/spack/spack/test/test_suite.py | 8 | ||||
-rw-r--r-- | lib/spack/spack/test/views.py | 1 |
12 files changed, 7 insertions, 21 deletions
diff --git a/lib/spack/spack/test/cmd/develop.py b/lib/spack/spack/test/cmd/develop.py index b090f0d21b..440a008a3c 100644 --- a/lib/spack/spack/test/cmd/develop.py +++ b/lib/spack/spack/test/cmd/develop.py @@ -18,8 +18,6 @@ add = SpackCommand("add") develop = SpackCommand("develop") env = SpackCommand("env") -pytestmark = pytest.mark.not_on_windows("does not run on windows") - @pytest.mark.usefixtures("mutable_mock_env_path", "mock_packages", "mock_fetch", "mutable_config") class TestDevelop: diff --git a/lib/spack/spack/test/cmd/find.py b/lib/spack/spack/test/cmd/find.py index 46f05ab6e9..59370b0d84 100644 --- a/lib/spack/spack/test/cmd/find.py +++ b/lib/spack/spack/test/cmd/find.py @@ -334,7 +334,6 @@ def test_find_command_basic_usage(database): assert "mpileaks" in output -@pytest.mark.not_on_windows("envirnment is not yet supported on windows") @pytest.mark.regression("9875") def test_find_prefix_in_env( mutable_mock_env_path, install_mockery, mock_fetch, mock_packages, mock_archive diff --git a/lib/spack/spack/test/cmd/gc.py b/lib/spack/spack/test/cmd/gc.py index e646f8f8d5..883d37ae33 100644 --- a/lib/spack/spack/test/cmd/gc.py +++ b/lib/spack/spack/test/cmd/gc.py @@ -16,8 +16,6 @@ gc = spack.main.SpackCommand("gc") add = spack.main.SpackCommand("add") install = spack.main.SpackCommand("install") -pytestmark = pytest.mark.not_on_windows("does not run on windows") - @pytest.mark.db def test_gc_without_build_dependency(mutable_database): diff --git a/lib/spack/spack/test/cmd/stage.py b/lib/spack/spack/test/cmd/stage.py index 26e88e4280..e91d2ed766 100644 --- a/lib/spack/spack/test/cmd/stage.py +++ b/lib/spack/spack/test/cmd/stage.py @@ -50,7 +50,6 @@ def check_stage_path(monkeypatch, tmpdir): return expected_path -@pytest.mark.not_on_windows("PermissionError") def test_stage_path(check_stage_path): """Verify that --path only works with single specs.""" stage("--path={0}".format(check_stage_path), "trivial-install-test-package") diff --git a/lib/spack/spack/test/cmd/undevelop.py b/lib/spack/spack/test/cmd/undevelop.py index 9b5a2a5692..684a9f5019 100644 --- a/lib/spack/spack/test/cmd/undevelop.py +++ b/lib/spack/spack/test/cmd/undevelop.py @@ -2,10 +2,6 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - - -import pytest - import spack.environment as ev import spack.spec from spack.main import SpackCommand @@ -14,8 +10,6 @@ undevelop = SpackCommand("undevelop") env = SpackCommand("env") concretize = SpackCommand("concretize") -pytestmark = pytest.mark.not_on_windows("does not run on windows") - def test_undevelop(tmpdir, mutable_config, mock_packages, mutable_mock_env_path): # setup environment diff --git a/lib/spack/spack/test/cmd/uninstall.py b/lib/spack/spack/test/cmd/uninstall.py index 78a5f10d5e..35b6a15455 100644 --- a/lib/spack/spack/test/cmd/uninstall.py +++ b/lib/spack/spack/test/cmd/uninstall.py @@ -205,7 +205,6 @@ def test_in_memory_consistency_when_uninstalling(mutable_database, monkeypatch): # Note: I want to use https://docs.pytest.org/en/7.1.x/how-to/skipping.html#skip-all-test-functions-of-a-class-or-module # the style formatter insists on separating these two lines. -@pytest.mark.not_on_windows("Envs unsupported on Windows") class TestUninstallFromEnv: """Tests an installation with two environments e1 and e2, which each have shared package installations: diff --git a/lib/spack/spack/test/concretize_errors.py b/lib/spack/spack/test/concretize_errors.py index 114942bc6d..0b3cf10933 100644 --- a/lib/spack/spack/test/concretize_errors.py +++ b/lib/spack/spack/test/concretize_errors.py @@ -8,8 +8,6 @@ import pytest import spack.solver.asp import spack.spec -pytestmark = [pytest.mark.not_on_windows("Windows uses old concretizer")] - version_error_messages = [ "Cannot satisfy 'fftw@:1.0' and 'fftw@1.1:", " required because quantum-espresso depends on fftw@:1.0", diff --git a/lib/spack/spack/test/concretize_requirements.py b/lib/spack/spack/test/concretize_requirements.py index 38fe4c296f..386ad1c194 100644 --- a/lib/spack/spack/test/concretize_requirements.py +++ b/lib/spack/spack/test/concretize_requirements.py @@ -19,8 +19,6 @@ from spack.spec import Spec from spack.test.conftest import create_test_repo from spack.util.url import path_to_file_url -pytestmark = [pytest.mark.not_on_windows("Windows uses old concretizer")] - def update_packages_config(conf_str): conf = syaml.load_config(conf_str) diff --git a/lib/spack/spack/test/container/cli.py b/lib/spack/spack/test/container/cli.py index fa57eac723..660f84aef1 100644 --- a/lib/spack/spack/test/container/cli.py +++ b/lib/spack/spack/test/container/cli.py @@ -27,7 +27,6 @@ def test_listing_possible_os(): assert expected_os in output -@pytest.mark.not_on_windows("test unsupported on Windows") @pytest.mark.maybeslow @pytest.mark.requires_executables("git") def test_bootstrap_phase(minimal_configuration, config_dumper, capsys): diff --git a/lib/spack/spack/test/package_class.py b/lib/spack/spack/test/package_class.py index 07a82c5358..1a44c19fb7 100644 --- a/lib/spack/spack/test/package_class.py +++ b/lib/spack/spack/test/package_class.py @@ -286,6 +286,7 @@ def test_package_test_no_compilers(mock_packages, monkeypatch, capfd): # TODO (post-34236): Remove when remove deprecated run_test(), etc. +@pytest.mark.not_on_windows("echo not available on Windows") @pytest.mark.parametrize( "msg,installed,purpose,expected", [ diff --git a/lib/spack/spack/test/test_suite.py b/lib/spack/spack/test/test_suite.py index 8820abe602..708c4788be 100644 --- a/lib/spack/spack/test/test_suite.py +++ b/lib/spack/spack/test/test_suite.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import collections import os +import sys import pytest @@ -315,8 +316,11 @@ def test_test_part_pass(install_mockery, mock_fetch, mock_test_stage): name = "test_echo" msg = "nothing" with spack.install_test.test_part(pkg, name, "echo"): - echo = which("echo") - echo(msg) + if sys.platform == "win32": + print(msg) + else: + echo = which("echo") + echo(msg) for part_name, status in pkg.tester.test_parts.items(): assert part_name.endswith(name) diff --git a/lib/spack/spack/test/views.py b/lib/spack/spack/test/views.py index d32d8e0150..c8ff50eeb9 100644 --- a/lib/spack/spack/test/views.py +++ b/lib/spack/spack/test/views.py @@ -12,7 +12,6 @@ from spack.filesystem_view import SimpleFilesystemView, YamlFilesystemView from spack.spec import Spec -@pytest.mark.not_on_windows("Not supported on Windows (yet)") def test_remove_extensions_ordered(install_mockery, mock_fetch, tmpdir): view_dir = str(tmpdir.join("view")) layout = DirectoryLayout(view_dir) |