Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory
python-before-after
pr_10.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pr_10.patch of Package python-before-after
From 11c0ecc7e8a2f90a762831e216c1bc40abfda43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> Date: Mon, 10 May 2021 22:01:00 +0200 Subject: [PATCH] Use built-in unittest.mock in Python 3.3+ --- before_after/__init__.py | 5 ++++- setup.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/before_after/__init__.py b/before_after/__init__.py index 1081684..e713a61 100644 --- a/before_after/__init__.py +++ b/before_after/__init__.py @@ -50,7 +50,10 @@ def inner(*a, **k): return ret return inner - from mock import patch + if sys.version_info >= (3, 3): + from unittest.mock import patch + else: + from mock import patch patcher = patch(target, **kwargs) original, _ = patcher.get_original() diff --git a/setup.py b/setup.py index 572470c..b1167df 100644 --- a/setup.py +++ b/setup.py @@ -31,8 +31,9 @@ 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', ], keywords=['testing', 'race conditions'], - install_requires=['mock>=1.0.1'], + install_requires=['mock>=1.0.1; python_version < "3.3"'], )
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor