diff --git a/conda-mock.patch b/conda-mock.patch new file mode 100644 index 0000000..1d5c89d --- /dev/null +++ b/conda-mock.patch @@ -0,0 +1,12 @@ +diff -up conda-4.11.0/tests/test_cli.py.mock conda-4.11.0/tests/test_cli.py +--- conda-4.11.0/tests/test_cli.py.mock 2021-11-22 09:23:00.000000000 -0700 ++++ conda-4.11.0/tests/test_cli.py 2022-02-08 20:02:50.273338217 -0700 +@@ -66,7 +66,7 @@ class TestJson(unittest.TestCase): + res = capture_json_with_argv('conda config --get use_pip --json') + self.assertJsonSuccess(res) + +- from mock import patch ++ from unittest.mock import patch + + @pytest.mark.integration + @patch("conda.core.envs_manager.get_user_environments_txt_file", return_value=os.devnull) diff --git a/conda.spec b/conda.spec index 67f1939..0557a68 100644 --- a/conda.spec +++ b/conda.spec @@ -24,6 +24,8 @@ Patch3: conda-cpuinfo.patch # Fix tests on 32bit # https://github.com/conda/conda/pull/9759 Patch4: conda-32bit.patch +# Fix mock import +Patch5: conda-mock.patch Patch10001: 0001-Fix-toolz-imports.patch Patch10003: 0003-Drop-fs-path-encoding-manipulation-under-python2.patch @@ -88,8 +90,6 @@ BuildRequires: python%{python3_pkgversion}-cytoolz >= 0.8.2 %endif # For tests BuildRequires: python-unversioned-command -BuildRequires: python%{python3_pkgversion}-mock -BuildRequires: python%{python3_pkgversion}-pytest-cov BuildRequires: python%{python3_pkgversion}-pytest-rerunfailures BuildRequires: python%{python3_pkgversion}-pytest-timeout BuildRequires: python%{python3_pkgversion}-responses @@ -147,6 +147,9 @@ cp -a tests/data/conda_format_repo/{linux-64,%{python3_platform}} sed -i -e s/linux-64/%{python3_platform}/ tests/data/conda_format_repo/%{python3_platform}/*json %endif +# do not run coverage in pytest +sed -i -E '/--(no-)?cov/d' setup.cfg + %build # build conda executable