From 1752fcd3a77183b76be98104f5b6f126888f315662dc48508215c7cdcde90fb9 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 13 Dec 2020 20:45:22 +0000 Subject: [PATCH] Accepting request 855604 from home:mcepl:branches:devel:tools:scm - We don't need to break Python 2.7 OBS-URL: https://build.opensuse.org/request/show/855604 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flaky?expand=0&rev=16 --- python-flaky.changes | 5 +++++ python-flaky.spec | 3 +++ remove_mock.patch | 7 +++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/python-flaky.changes b/python-flaky.changes index 953e35a..52a9a36 100644 --- a/python-flaky.changes +++ b/python-flaky.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Dec 13 20:27:15 UTC 2020 - Matej Cepl + +- We don't need to break Python 2.7 + ------------------------------------------------------------------- Fri Dec 11 15:14:53 UTC 2020 - Matej Cepl diff --git a/python-flaky.spec b/python-flaky.spec index 2c66d43..ab0c602 100644 --- a/python-flaky.spec +++ b/python-flaky.spec @@ -45,6 +45,9 @@ BuildArch: noarch BuildRequires: %{python_module flaky >= %{version}} BuildRequires: %{python_module genty} BuildRequires: %{python_module pytest} +%if "%{python_flavor}" == "python2" +BuildRequires: %{python_module mock} +%endif %endif %python_subpackages diff --git a/remove_mock.patch b/remove_mock.patch index ec41878..115255a 100644 --- a/remove_mock.patch +++ b/remove_mock.patch @@ -1,11 +1,14 @@ --- a/test/test_pytest/test_flaky_pytest_plugin.py +++ b/test/test_pytest/test_flaky_pytest_plugin.py -@@ -2,7 +2,7 @@ +@@ -2,7 +2,10 @@ from __future__ import unicode_literals from io import StringIO -from mock import Mock, patch -+from unittest.mock import Mock, patch ++try: ++ from unittest.mock import Mock, patch ++except ImportError: ++ from mock import Mock, patch # pylint:disable=import-error import pytest from _pytest.runner import CallInfo