diff --git a/.github/workflows/unix_impl.yml b/.github/workflows/unix_impl.yml index 9c84115010..d152ada956 100644 --- a/.github/workflows/unix_impl.yml +++ b/.github/workflows/unix_impl.yml @@ -162,7 +162,7 @@ jobs: run: | export TEST_MAMBA_EXE=$(pwd)/build/micromamba/mamba unset CONDARC # Interferes with tests - python -m pytest micromamba/tests/test_repoquery.py::test_whoneeds_not_installed_with_channel_no_json \ + python -m pytest micromamba/tests/ \ ${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }} verify_pkg_tests: diff --git a/.github/workflows/windows_impl.yml b/.github/workflows/windows_impl.yml index fb6a713555..f545d5e5bb 100644 --- a/.github/workflows/windows_impl.yml +++ b/.github/workflows/windows_impl.yml @@ -149,5 +149,5 @@ jobs: $env:TEST_MAMBA_EXE = Join-Path -Path $pwd -ChildPath 'local\bin\mamba.exe' $env:MAMBA_TEST_SHELL_TYPE='powershell' Remove-Item -Path "env:CONDARC" - python -m pytest micromamba/tests/test_repoquery.py::test_whoneeds_not_installed_with_channel_no_json ` + python -m pytest micromamba/tests/ ` ${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }} diff --git a/libmamba/src/core/query.cpp b/libmamba/src/core/query.cpp index 027bf9feb7..229aebe12c 100644 --- a/libmamba/src/core/query.cpp +++ b/libmamba/src/core/query.cpp @@ -586,10 +586,6 @@ namespace mamba auto QueryResult::table(std::ostream& out, const std::vector& columns) const -> std::ostream& { - for (auto& col : columns) - { - std::cout << "col: " << col << std::endl; - } if (m_pkg_id_list.empty()) { out << "No entries matching \"" << m_query << "\" found" << std::endl; @@ -624,13 +620,9 @@ namespace mamba else { auto sfmt = util::split(col, ":", 1); - std::cout << "sfmt[0]: " << sfmt[0] << " sfmt[1]: " << sfmt[1] << std::endl; headers.emplace_back(sfmt[0]); cmds.push_back(sfmt[0]); args.push_back(sfmt[1]); - - std::cout << "just after push back, last cmd: " << cmds.back() << std::endl; - std::cout << "just after push back, last arg: " << args.back() << std::endl; } // By default, columns are left aligned. alignments.push_back(printers::alignment::left); @@ -639,17 +631,6 @@ namespace mamba auto format_row = [&](const specs::PackageInfo& pkg, const std::vector& builds) { - std::cout << " IN format_row, cmds size: " << cmds.size() - << " args size: " << args.size() << std::endl; - for (auto& c : cmds) - { - std::cout << "cmd: " << c << std::endl; - } - for (auto& a : args) - { - std::cout << "arg: " << a << std::endl; - } - // throw; // stop execution for debugging std::vector row; for (std::size_t i = 0; i < cmds.size(); ++i) { @@ -686,19 +667,11 @@ namespace mamba } else if (cmd == "Depends") { - std::cout << "CMD is depends" << std::endl; - // std::cout << "pkg name: " << pkg.name - // << " and deps size: " << - // pkg.dependencies.size() << std::endl; std::string depends_qualifier; for (const auto& dep : pkg.dependencies) { - // std::cout << "dep: " << dep << " args i: " << - // args[i] << std::endl; if (util::starts_with(dep, args[i])) { - // std::cout << "Pushing bak dep " << - // std::endl; depends_qualifier = dep; break; } diff --git a/micromamba/tests/test_repoquery.py b/micromamba/tests/test_repoquery.py index a8bbcd6fa4..3c29714127 100644 --- a/micromamba/tests/test_repoquery.py +++ b/micromamba/tests/test_repoquery.py @@ -162,33 +162,18 @@ def test_whoneeds_not_installed_with_channel(yaml_env: Path, with_platform): assert any(x["name"] == "qpot" for x in pkgs) -# @pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True) -# @pytest.mark.parametrize("spec", ("xtensor", "xtensor=0.24.5")) -# def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path, spec): -# res = helpers.umamba_repoquery("whoneeds", "-c", "conda-forge", spec, "--platform", "osx-64") -# assert "Name Version Build Depends Channel Subdir" in helpers.remove_whitespaces(res) -# if spec == "xtensor=0.24.5": # `Depends` column is empty here (bug?) -# print(res) -# assert "cascade 0.1.1 py38h5ce3968_0 conda-forge osx-64" in helpers.remove_whitespaces(res) -# else: -# print(res) -# assert ( -# "cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64" -# in helpers.remove_whitespaces(res) -# ) - - -# @pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True) -def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path): - res = helpers.umamba_repoquery( - "whoneeds", "-c", "conda-forge", "xtensor", "--platform", "osx-64" - ) +@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True) +@pytest.mark.parametrize("spec", ("xtensor", "xtensor=0.24.5")) +def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path, spec): + res = helpers.umamba_repoquery("whoneeds", "-c", "conda-forge", spec, "--platform", "osx-64") assert "Name Version Build Depends Channel Subdir" in helpers.remove_whitespaces(res) - - print(res) - assert "cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64" in helpers.remove_whitespaces( - res - ) + if spec == "xtensor=0.24.5": # `Depends` column is empty here (bug?) + assert "cascade 0.1.1 py38h5ce3968_0 conda-forge osx-64" in helpers.remove_whitespaces(res) + else: + assert ( + "cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64" + in helpers.remove_whitespaces(res) + ) @pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)