Remove debug print statements in unit-tests (#49280)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:
parent
11051ce5c7
commit
bc04d963e5
@ -569,7 +569,6 @@ def test_FetchCacheError_only_accepts_lists_of_errors():
|
||||
def test_FetchCacheError_pretty_printing_multiple():
|
||||
e = bindist.FetchCacheError([RuntimeError("Oops!"), TypeError("Trouble!")])
|
||||
str_e = str(e)
|
||||
print("'" + str_e + "'")
|
||||
assert "Multiple errors" in str_e
|
||||
assert "Error 1: RuntimeError: Oops!" in str_e
|
||||
assert "Error 2: TypeError: Trouble!" in str_e
|
||||
|
@ -210,7 +210,6 @@ def check_args_contents(cc, args, must_contain, must_not_contain):
|
||||
"""
|
||||
with set_env(SPACK_TEST_COMMAND="dump-args"):
|
||||
cc_modified_args = cc(*args, output=str).strip().split("\n")
|
||||
print(cc_modified_args)
|
||||
for a in must_contain:
|
||||
assert a in cc_modified_args
|
||||
for a in must_not_contain:
|
||||
|
@ -347,7 +347,6 @@ def test_get_spec_filter_list(mutable_mock_env_path, mutable_mock_repo):
|
||||
for key, val in expectations.items():
|
||||
affected_specs = ci.get_spec_filter_list(e1, touched, dependent_traverse_depth=key)
|
||||
affected_pkg_names = set([s.name for s in affected_specs])
|
||||
print(f"{key}: {affected_pkg_names}")
|
||||
assert affected_pkg_names == val
|
||||
|
||||
|
||||
|
@ -214,9 +214,7 @@ def verify_mirror_contents():
|
||||
if in_env_pkg in p:
|
||||
found_pkg = True
|
||||
|
||||
if not found_pkg:
|
||||
print("Expected to find {0} in {1}".format(in_env_pkg, dest_mirror_dir))
|
||||
assert False
|
||||
assert found_pkg, f"Expected to find {in_env_pkg} in {dest_mirror_dir}"
|
||||
|
||||
# Install a package and put it in the buildcache
|
||||
s = spack.concretize.concretize_one(out_env_pkg)
|
||||
|
@ -898,7 +898,6 @@ def test_cdash_configure_warning(tmpdir, mock_fetch, install_mockery, capfd):
|
||||
specfile = "./spec.json"
|
||||
with open(specfile, "w", encoding="utf-8") as f:
|
||||
f.write(spec.to_json())
|
||||
print(spec.to_json())
|
||||
install("--log-file=cdash_reports", "--log-format=cdash", specfile)
|
||||
# Verify Configure.xml exists with expected contents.
|
||||
report_dir = tmpdir.join("cdash_reports")
|
||||
|
@ -50,7 +50,7 @@ def test_list_long(capsys):
|
||||
def test_list_long_with_pytest_arg(capsys):
|
||||
with capsys.disabled():
|
||||
output = spack_test("--list-long", cmd_test_py)
|
||||
print(output)
|
||||
|
||||
assert "unit_test.py::\n" in output
|
||||
assert "test_list" in output
|
||||
assert "test_list_with_pytest_arg" in output
|
||||
|
@ -49,7 +49,6 @@ def test_single_file_verify_cmd(tmpdir):
|
||||
sjson.dump({filepath: data}, f)
|
||||
|
||||
results = verify("manifest", "-f", filepath, fail_on_error=False)
|
||||
print(results)
|
||||
assert not results
|
||||
|
||||
os.utime(filepath, (0, 0))
|
||||
|
@ -2018,7 +2018,6 @@ def test_git_ref_version_is_equivalent_to_specified_version(self, git_ref):
|
||||
s = Spec("develop-branch-version@git.%s=develop" % git_ref)
|
||||
c = spack.concretize.concretize_one(s)
|
||||
assert git_ref in str(c)
|
||||
print(str(c))
|
||||
assert s.satisfies("@develop")
|
||||
assert s.satisfies("@0.1:")
|
||||
|
||||
|
@ -2148,7 +2148,6 @@ def _c_compiler_always_exists():
|
||||
@pytest.fixture(scope="session")
|
||||
def mock_test_cache(tmp_path_factory):
|
||||
cache_dir = tmp_path_factory.mktemp("cache")
|
||||
print(cache_dir)
|
||||
return spack.util.file_cache.FileCache(cache_dir)
|
||||
|
||||
|
||||
|
@ -977,7 +977,6 @@ class MyBuildException(Exception):
|
||||
|
||||
|
||||
def _install_fail_my_build_exception(installer, task, install_status, **kwargs):
|
||||
print(task, task.pkg.name)
|
||||
if task.pkg.name == "pkg-a":
|
||||
raise MyBuildException("mock internal package build error for pkg-a")
|
||||
else:
|
||||
|
@ -27,9 +27,7 @@ def check_spliced_spec_prefixes(spliced_spec):
|
||||
text_file_path = os.path.join(node.prefix, node.name)
|
||||
with open(text_file_path, "r", encoding="utf-8") as f:
|
||||
text = f.read()
|
||||
print(text)
|
||||
for modded_spec in node.traverse(root=True, deptype=dt.ALL & ~dt.BUILD):
|
||||
print(modded_spec)
|
||||
assert modded_spec.prefix in text
|
||||
|
||||
|
||||
|
@ -149,11 +149,8 @@ def test_reverse_environment_modifications(working_env):
|
||||
os.environ.clear()
|
||||
os.environ.update(start_env)
|
||||
|
||||
print(os.environ)
|
||||
to_reverse.apply_modifications()
|
||||
print(os.environ)
|
||||
reversal.apply_modifications()
|
||||
print(os.environ)
|
||||
|
||||
start_env.pop("UNSET")
|
||||
assert os.environ == start_env
|
||||
|
@ -257,7 +257,6 @@ def test_core_lib_files():
|
||||
names.append(os.path.join(test_dir, n))
|
||||
|
||||
for filename in names:
|
||||
print("Testing %s" % filename)
|
||||
source = read_pyfile(filename)
|
||||
check_ast_roundtrip(source)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user