Use standard library mock
This commit is contained in:
parent
e860a3c750
commit
849db7c1a6
36
Use-from-unittest-import-mock-instead-of-just-import.patch
Normal file
36
Use-from-unittest-import-mock-instead-of-just-import.patch
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
From f41791d752a7a398b57f88e07bb2871ae533ca1c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mike FABIAN <mfabian@redhat.com>
|
||||||
|
Date: Tue, 2 Feb 2021 11:42:49 +0100
|
||||||
|
Subject: [PATCH] =?UTF-8?q?Use=20=E2=80=9Cfrom=20unittest=20import=20mock?=
|
||||||
|
=?UTF-8?q?=E2=80=9D=20instead=20of=20just=20=E2=80=9Cimport=20mock?=
|
||||||
|
=?UTF-8?q?=E2=80=9D.?=
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Since Python 3.3, mock is part of unittest in the standard
|
||||||
|
library. The third-party `mock` library is a backport for older Python
|
||||||
|
versions.
|
||||||
|
|
||||||
|
This makes it possible to remove the “BuildRequires: python3-mock”
|
||||||
|
from the ibus-table.spec file.
|
||||||
|
---
|
||||||
|
tests/test_it.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tests/test_it.py b/tests/test_it.py
|
||||||
|
index a4b6ba6..cad55c1 100755
|
||||||
|
--- a/tests/test_it.py
|
||||||
|
+++ b/tests/test_it.py
|
||||||
|
@@ -29,7 +29,7 @@ import logging
|
||||||
|
import time
|
||||||
|
import unittest
|
||||||
|
import importlib
|
||||||
|
-import mock
|
||||||
|
+from unittest import mock
|
||||||
|
|
||||||
|
from gi import require_version
|
||||||
|
require_version('IBus', '1.0')
|
||||||
|
--
|
||||||
|
2.29.2
|
||||||
|
|
@ -1,10 +1,11 @@
|
|||||||
Name: ibus-table
|
Name: ibus-table
|
||||||
Version: 1.12.4
|
Version: 1.12.4
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Summary: The Table engine for IBus platform
|
Summary: The Table engine for IBus platform
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: http://code.google.com/p/ibus/
|
URL: http://code.google.com/p/ibus/
|
||||||
Source0: http://mfabian.fedorapeople.org/ibus-table/%{name}-%{version}.tar.gz
|
Source0: http://mfabian.fedorapeople.org/ibus-table/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: Use-from-unittest-import-mock-instead-of-just-import.patch
|
||||||
Requires: ibus > 1.3.0
|
Requires: ibus > 1.3.0
|
||||||
%{?__python3:Requires: %{__python3}}
|
%{?__python3:Requires: %{__python3}}
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
@ -14,7 +15,6 @@ BuildRequires: python3-devel
|
|||||||
BuildRequires: appstream
|
BuildRequires: appstream
|
||||||
BuildRequires: libappstream-glib
|
BuildRequires: libappstream-glib
|
||||||
BuildRequires: desktop-file-utils
|
BuildRequires: desktop-file-utils
|
||||||
BuildRequires: python3-mock
|
|
||||||
BuildRequires: python3-gobject
|
BuildRequires: python3-gobject
|
||||||
BuildRequires: python3-gobject-base
|
BuildRequires: python3-gobject-base
|
||||||
BuildRequires: dbus-x11
|
BuildRequires: dbus-x11
|
||||||
@ -54,6 +54,7 @@ the functionality of the installed %{name} package.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch0 -p1 -b .use-standard-library-mock
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export PYTHON=%{__python3}
|
export PYTHON=%{__python3}
|
||||||
@ -147,6 +148,9 @@ fi
|
|||||||
%{_datadir}/installed-tests/%{name}
|
%{_datadir}/installed-tests/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Feb 02 2021 Mike FABIAN <mfabian@redhat.com> - 1.12.4-3
|
||||||
|
- Use standard library mock
|
||||||
|
|
||||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.4-2
|
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.4-2
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user