From 912d544afeb24876af87757ccf99c70306f104b4 Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Fri, 4 Nov 2022 14:52:58 -0700 Subject: demote warning for no source id to debug message (#33657) * demote warning for no source id to debug message --- lib/spack/spack/package_base.py | 2 +- lib/spack/spack/test/conftest.py | 10 ++++++++++ lib/spack/spack/test/install.py | 6 ++++-- lib/spack/spack/test/test_suite.py | 12 ------------ 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/package_base.py b/lib/spack/spack/package_base.py index 1871e6785b..e0e250cf7c 100644 --- a/lib/spack/spack/package_base.py +++ b/lib/spack/spack/package_base.py @@ -1647,7 +1647,7 @@ class PackageBase(six.with_metaclass(PackageMeta, WindowsRPathMeta, PackageViewM from_local_sources = env and env.is_develop(self.spec) if self.has_code and not self.spec.external and not from_local_sources: message = "Missing a source id for {s.name}@{s.version}" - tty.warn(message.format(s=self)) + tty.debug(message.format(s=self)) hash_content.append("".encode("utf-8")) else: hash_content.append(source_id.encode("utf-8")) diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py index 2f04e1d4fd..2ab8c89c3b 100644 --- a/lib/spack/spack/test/conftest.py +++ b/lib/spack/spack/test/conftest.py @@ -591,6 +591,16 @@ def linux_os(): return LinuxOS(name=name, version=version) +@pytest.fixture +def ensure_debug(monkeypatch): + current_debug_level = tty.debug_level() + tty.set_debug(1) + + yield + + tty.set_debug(current_debug_level) + + @pytest.fixture(autouse=is_windows, scope="session") def platform_config(): spack.config.add_default_platform_scope(spack.platforms.real_host().name) diff --git a/lib/spack/spack/test/install.py b/lib/spack/spack/test/install.py index e8b6f415d3..da54216402 100644 --- a/lib/spack/spack/test/install.py +++ b/lib/spack/spack/test/install.py @@ -429,7 +429,7 @@ def test_uninstall_by_spec_errors(mutable_database): @pytest.mark.disable_clean_stage_check -def test_nosource_pkg_install(install_mockery, mock_fetch, mock_packages, capfd): +def test_nosource_pkg_install(install_mockery, mock_fetch, mock_packages, capfd, ensure_debug): """Test install phases with the nosource package.""" spec = Spec("nosource").concretized() pkg = spec.package @@ -444,7 +444,9 @@ def test_nosource_pkg_install(install_mockery, mock_fetch, mock_packages, capfd) @pytest.mark.disable_clean_stage_check -def test_nosource_bundle_pkg_install(install_mockery, mock_fetch, mock_packages, capfd): +def test_nosource_bundle_pkg_install( + install_mockery, mock_fetch, mock_packages, capfd, ensure_debug +): """Test install phases with the nosource-bundle package.""" spec = Spec("nosource-bundle").concretized() pkg = spec.package diff --git a/lib/spack/spack/test/test_suite.py b/lib/spack/spack/test/test_suite.py index 3d8ebace39..7db59526ca 100644 --- a/lib/spack/spack/test/test_suite.py +++ b/lib/spack/spack/test/test_suite.py @@ -7,8 +7,6 @@ import sys import pytest -import llnl.util.tty as tty - import spack.install_test import spack.spec @@ -20,16 +18,6 @@ def _true(*args, **kwargs): return True -@pytest.fixture -def ensure_debug(monkeypatch): - current_debug_level = tty.debug_level() - tty.set_debug(1) - - yield - - tty.set_debug(current_debug_level) - - def ensure_results(filename, expected): assert os.path.exists(filename) with open(filename, "r") as fd: -- cgit v1.2.3-60-g2f50