Backport PR #317 (call reset from setUp / tearDown)
This commit is contained in:
parent
b474483eb2
commit
a4977cf41f
@ -0,0 +1,37 @@
|
|||||||
|
From 01474bf64e0434881059a3638abff5bb62eaedb1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Scott Moser <smoser@brickies.net>
|
||||||
|
Date: Tue, 24 Jan 2017 12:30:47 -0500
|
||||||
|
Subject: [PATCH] Call reset from setUp and tearDown in addition to enable and
|
||||||
|
disable.
|
||||||
|
|
||||||
|
When decorating a class via setUp and tearDown, reset() was not being
|
||||||
|
called. That was an unintentional change in behavior from previous versions.
|
||||||
|
|
||||||
|
Addresses #316.
|
||||||
|
---
|
||||||
|
httpretty/core.py | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/httpretty/core.py b/httpretty/core.py
|
||||||
|
index 34d1ed1..c408c38 100644
|
||||||
|
--- a/httpretty/core.py
|
||||||
|
+++ b/httpretty/core.py
|
||||||
|
@@ -1189,6 +1189,7 @@ def httprettified(test):
|
||||||
|
if hasattr(klass, 'setUp')
|
||||||
|
else None)
|
||||||
|
def new_setUp(self):
|
||||||
|
+ httpretty.reset()
|
||||||
|
httpretty.enable()
|
||||||
|
if use_addCleanup:
|
||||||
|
self.addCleanup(httpretty.disable)
|
||||||
|
@@ -1202,6 +1203,7 @@ def httprettified(test):
|
||||||
|
else None)
|
||||||
|
def new_tearDown(self):
|
||||||
|
httpretty.disable()
|
||||||
|
+ httpretty.reset()
|
||||||
|
if original_tearDown:
|
||||||
|
original_tearDown(self)
|
||||||
|
klass.tearDown = new_tearDown
|
||||||
|
--
|
||||||
|
2.9.3
|
||||||
|
|
@ -16,7 +16,7 @@
|
|||||||
Name: python-httpretty
|
Name: python-httpretty
|
||||||
Version: 0.8.14
|
Version: 0.8.14
|
||||||
# If github_date is defined, assume a post-release snapshot
|
# If github_date is defined, assume a post-release snapshot
|
||||||
Release: 1%{?github_date:.%{github_date}git%{shortcommit}}%{?dist}
|
Release: 2%{?github_date:.%{github_date}git%{shortcommit}}%{?dist}
|
||||||
Summary: HTTP request mock tool for Python
|
Summary: HTTP request mock tool for Python
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -56,6 +56,10 @@ Patch2: python-httpretty-fakesock_getpeercert_noconnect.patch
|
|||||||
# https://github.com/gabrielfalcao/HTTPretty/pull/315
|
# https://github.com/gabrielfalcao/HTTPretty/pull/315
|
||||||
Patch3: 0001-Handle-bugs-in-older-urllib3-versions-in-one-of-the-.patch
|
Patch3: 0001-Handle-bugs-in-older-urllib3-versions-in-one-of-the-.patch
|
||||||
|
|
||||||
|
# Fix setUp and tearDown not calling reset
|
||||||
|
# https://github.com/gabrielfalcao/HTTPretty/pull/317
|
||||||
|
Patch4: 0001-Call-reset-from-setUp-and-tearDown-in-addition-to-en.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
Requires: python-urllib3
|
Requires: python-urllib3
|
||||||
@ -180,6 +184,9 @@ popd
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jan 27 2017 Adam Williamson <awilliam@redhat.com> - 0.8.14-2.20161011git70af1f8
|
||||||
|
- Backport PR #317 (call reset from setUp / tearDown) - thanks gholms
|
||||||
|
|
||||||
* Fri Jan 06 2017 Adam Williamson <awilliam@redhat.com> - 0.8.14-1.20161011git70af1f8
|
* Fri Jan 06 2017 Adam Williamson <awilliam@redhat.com> - 0.8.14-1.20161011git70af1f8
|
||||||
- Update to current git master (as a 0.8.14 post-release snapshot)
|
- Update to current git master (as a 0.8.14 post-release snapshot)
|
||||||
- Backport PR #313 (fix with recent OpenSSL, requests and urllib3)
|
- Backport PR #313 (fix with recent OpenSSL, requests and urllib3)
|
||||||
|
Loading…
Reference in New Issue
Block a user