diff --git a/460-miliseconds_tests.patch b/460-miliseconds_tests.patch new file mode 100644 index 0000000..3c6dec0 --- /dev/null +++ b/460-miliseconds_tests.patch @@ -0,0 +1,99 @@ +From 2098d2cfb221995a2523fec3984641f4a15812cc Mon Sep 17 00:00:00 2001 +From: Sarah Julia Kriesch +Date: Thu, 27 Oct 2022 08:55:50 +0200 +Subject: [PATCH 1/2] Fix build issues based on tests with the requirement of 2 + miliseconds #459 + +Signed-off-by: Sarah Julia Kriesch +--- + tests/functional/test_httplib2.py | 9 +++------ + tests/functional/test_urllib2.py | 7 ++----- + 2 files changed, 5 insertions(+), 11 deletions(-) + +diff --git a/tests/functional/test_httplib2.py b/tests/functional/test_httplib2.py +index c913d8a8..6cb27e1b 100644 +--- a/tests/functional/test_httplib2.py ++++ b/tests/functional/test_httplib2.py +@@ -112,8 +112,7 @@ def test_httpretty_should_allow_adding_and_overwritting_httplib2(): + + + @httprettified +-@within(two=miliseconds) +-def test_httpretty_should_allow_forcing_headers_httplib2(now): ++def test_httpretty_should_allow_forcing_headers_httplib2(): + "HTTPretty should allow forcing headers with httplib2" + + HTTPretty.register_uri(HTTPretty.GET, "http://github.com/foo", +@@ -165,8 +164,7 @@ def test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2(): + + + @httprettified +-@within(two=miliseconds) +-def test_rotating_responses_with_httplib2(now): ++def test_rotating_responses_with_httplib2(): + "HTTPretty should support rotating responses with httplib2" + + HTTPretty.register_uri( +@@ -248,8 +246,7 @@ def test_can_inspect_last_request_with_ssl(now): + + + @httprettified +-@within(two=miliseconds) +-def test_httpretty_ignores_querystrings_from_registered_uri(now): ++def test_httpretty_ignores_querystrings_from_registered_uri(): + "Registering URIs with query string cause them to be ignored" + + HTTPretty.register_uri(HTTPretty.GET, "http://yipit.com/?id=123", +diff --git a/tests/functional/test_urllib2.py b/tests/functional/test_urllib2.py +index 9c8ff39f..4cba7253 100644 +--- a/tests/functional/test_urllib2.py ++++ b/tests/functional/test_urllib2.py +@@ -127,7 +127,6 @@ def test_httpretty_should_allow_adding_and_overwritting_urllib2(): + + + @httprettified +-@within(two=miliseconds) + def test_httpretty_should_allow_forcing_headers_urllib2(): + "HTTPretty should allow forcing headers with urllib2" + +@@ -177,8 +176,7 @@ def test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2(): + + + @httprettified +-@within(two=miliseconds) +-def test_httpretty_should_support_a_list_of_successive_responses_urllib2(now): ++def test_httpretty_should_support_a_list_of_successive_responses_urllib2(): + ("HTTPretty should support adding a list of successive " + "responses with urllib2") + +@@ -285,8 +283,7 @@ def test_httpretty_ignores_querystrings_from_registered_uri(): + + + @httprettified +-@within(two=miliseconds) +-def test_callback_response(now): ++def test_callback_response(): + ("HTTPretty should call a callback function to be set as the body with" + " urllib2") + + +From 063a58bb8a7c2f213c07b343a5e1fe48944f1f08 Mon Sep 17 00:00:00 2001 +From: Sarah Julia Kriesch +Date: Thu, 27 Oct 2022 09:20:40 +0200 +Subject: [PATCH 2/2] Fix asertion error with 0,24 instead of 0,2 #459 + +Signed-off-by: Sarah Julia Kriesch +--- + tests/bugfixes/nosetests/test_430_respect_timeout.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/bugfixes/nosetests/test_430_respect_timeout.py b/tests/bugfixes/nosetests/test_430_respect_timeout.py +index f21a5468..ed5866b9 100644 +--- a/tests/bugfixes/nosetests/test_430_respect_timeout.py ++++ b/tests/bugfixes/nosetests/test_430_respect_timeout.py +@@ -51,4 +51,4 @@ def my_callback(request, url, headers): + # And the total execution time should be less than 0.2 seconds + event.set() + total_time = time.time() - started_at +- total_time.should.be.lower_than(0.2) ++ total_time.should.be.lower_than(0.24) diff --git a/python-httpretty.changes b/python-httpretty.changes index 3818671..466c392 100644 --- a/python-httpretty.changes +++ b/python-httpretty.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Oct 27 16:52:32 UTC 2022 - Sarah Kriesch + +- Add patch 460-miliseconds_tests.patch (gh#gabrielfalcao/HTTPretty#460): + * Correct tests for s390x and aarch64 because of timeout failures + after 2 miliseconds + ------------------------------------------------------------------- Sun Aug 8 09:17:40 UTC 2022 - Ben Greiner diff --git a/python-httpretty.spec b/python-httpretty.spec index c48c758..dd39efd 100644 --- a/python-httpretty.spec +++ b/python-httpretty.spec @@ -32,6 +32,8 @@ Patch1: 453-fix-tests-pytest.patch # PATCH-FIX-OPENSUSE test_double_slash may be replaced with / from stdlib # gh#gabrielfalcao/HTTPretty#457 Patch2: double-slash-paths.patch +#PATCH-FIX-UPSTREAM 460-fix-tests-two-miliseconds +Patch3: 460-miliseconds_tests.patch BuildRequires: %{python_module boto3} BuildRequires: %{python_module eventlet} BuildRequires: %{python_module fakeredis}