forked from pool/python-fire
Accepting request 962189 from home:pgajdos:python
- do not require python-mock for build - added patches fix https://github.com/google/python-fire/pull/265/files + python-fire-no-mock.patch OBS-URL: https://build.opensuse.org/request/show/962189 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fire?expand=0&rev=21
This commit is contained in:
83
python-fire-no-mock.patch
Normal file
83
python-fire-no-mock.patch
Normal file
@@ -0,0 +1,83 @@
|
||||
Index: fire-0.4.0/fire/core_test.py
|
||||
===================================================================
|
||||
--- fire-0.4.0.orig/fire/core_test.py 2020-04-03 19:14:51.000000000 +0200
|
||||
+++ fire-0.4.0/fire/core_test.py 2022-03-16 13:48:27.568077390 +0100
|
||||
@@ -22,7 +22,11 @@ from fire import core
|
||||
from fire import test_components as tc
|
||||
from fire import testutils
|
||||
from fire import trace
|
||||
-import mock
|
||||
+
|
||||
+try:
|
||||
+ import mock # python 2.x
|
||||
+except ModuleNotFoundError:
|
||||
+ from unittest import mock # python 3.x
|
||||
|
||||
import six
|
||||
|
||||
Index: fire-0.4.0/fire/fire_import_test.py
|
||||
===================================================================
|
||||
--- fire-0.4.0.orig/fire/fire_import_test.py 2022-03-16 13:48:27.568077390 +0100
|
||||
+++ fire-0.4.0/fire/fire_import_test.py 2022-03-16 13:51:27.561140579 +0100
|
||||
@@ -18,7 +18,11 @@ import sys
|
||||
|
||||
import fire
|
||||
from fire import testutils
|
||||
-import mock
|
||||
+
|
||||
+try:
|
||||
+ import mock # python 2.x
|
||||
+except ModuleNotFoundError:
|
||||
+ from unittest import mock # python 3.x
|
||||
|
||||
|
||||
class FireImportTest(testutils.BaseTestCase):
|
||||
Index: fire-0.4.0/fire/fire_test.py
|
||||
===================================================================
|
||||
--- fire-0.4.0.orig/fire/fire_test.py 2020-12-17 01:20:39.000000000 +0100
|
||||
+++ fire-0.4.0/fire/fire_test.py 2022-03-16 13:48:27.568077390 +0100
|
||||
@@ -25,7 +25,10 @@ import fire
|
||||
from fire import test_components as tc
|
||||
from fire import testutils
|
||||
|
||||
-import mock
|
||||
+try:
|
||||
+ import mock # python 2.x
|
||||
+except ModuleNotFoundError:
|
||||
+ from unittest import mock # python 3.x
|
||||
import six
|
||||
|
||||
|
||||
Index: fire-0.4.0/fire/interact_test.py
|
||||
===================================================================
|
||||
--- fire-0.4.0.orig/fire/interact_test.py 2022-03-16 13:48:27.568077390 +0100
|
||||
+++ fire-0.4.0/fire/interact_test.py 2022-03-16 13:50:36.080836493 +0100
|
||||
@@ -21,8 +21,10 @@ from __future__ import print_function
|
||||
from fire import interact
|
||||
from fire import testutils
|
||||
|
||||
-import mock
|
||||
-
|
||||
+try:
|
||||
+ import mock # python 2.x
|
||||
+except ModuleNotFoundError:
|
||||
+ from unittest import mock # python 3.x
|
||||
|
||||
try:
|
||||
import IPython # pylint: disable=unused-import, g-import-not-at-top
|
||||
Index: fire-0.4.0/fire/testutils.py
|
||||
===================================================================
|
||||
--- fire-0.4.0.orig/fire/testutils.py 2020-12-17 01:20:39.000000000 +0100
|
||||
+++ fire-0.4.0/fire/testutils.py 2022-03-16 13:48:27.568077390 +0100
|
||||
@@ -28,7 +28,10 @@ import unittest
|
||||
from fire import core
|
||||
from fire import trace
|
||||
|
||||
-import mock
|
||||
+try:
|
||||
+ import mock # python 2.x
|
||||
+except ModuleNotFoundError:
|
||||
+ from unittest import mock # python 3.x
|
||||
import six
|
||||
|
||||
|
||||
Reference in New Issue
Block a user