Merge pull request #383 from HttpRunner/bugfix

fix #112: RecursionError when running locust
This commit is contained in:
debugtalk
2018-09-06 17:58:34 +08:00
committed by GitHub
5 changed files with 10 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
__title__ = 'HttpRunner'
__description__ = 'One-stop solution for HTTP(S) testing.'
__url__ = 'https://github.com/HttpRunner/HttpRunner'
__version__ = '1.5.13'
__version__ = '1.5.14'
__author__ = 'debugtalk'
__author_email__ = 'mail@debugtalk.com'
__license__ = 'MIT'

View File

@@ -1,3 +1,9 @@
# encoding: utf-8
try:
# monkey patch at beginning to avoid RecursionError when running locust.
from gevent import monkey; monkey.patch_all()
except ImportError:
pass
from httprunner.api import HttpRunner, LocustRunner

View File

@@ -1,7 +1,7 @@
- config:
name: basic test with httpbin
request:
base_url: http://httpbin.org/
base_url: https://httpbin.org/
- test:
name: index
@@ -98,6 +98,3 @@
- len_eq: ["content", 9]
- len_eq: ["json", 9]
- len_eq: ["text", 9]

View File

@@ -173,7 +173,7 @@ class TestHttpRunner(ApiServerUnittest):
end_time = time.time()
summary = runner.summary
self.assertTrue(summary["success"])
self.assertLess(end_time - start_time, 10)
self.assertLess(end_time - start_time, 20)
def test_run_httprunner_with_teardown_hooks_alter_response(self):
testcases = [

View File

@@ -136,7 +136,7 @@ class TestResponse(ApiServerUnittest):
]
extract_binds_dict = resp_obj.extract_response(extract_binds_list)
self.assertGreater(extract_binds_dict["resp_elapsed_microseconds"], 1000)
self.assertLess(extract_binds_dict["resp_elapsed_seconds"], 3)
self.assertLess(extract_binds_dict["resp_elapsed_seconds"], 10)
self.assertEqual(extract_binds_dict["resp_elapsed_days"], 0)
self.assertGreater(extract_binds_dict["resp_elapsed_total_seconds"], 0)