mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 18:11:21 +08:00
Merge pull request #383 from HttpRunner/bugfix
fix #112: RecursionError when running locust
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user