mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
bugfix: Python2 does not support encoding parameter in open function; use codecs.open instead.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import codecs
|
||||
import hashlib
|
||||
import hmac
|
||||
import json
|
||||
@@ -5,8 +6,8 @@ import os.path
|
||||
import random
|
||||
import re
|
||||
import string
|
||||
|
||||
import yaml
|
||||
|
||||
from ate import exception
|
||||
|
||||
try:
|
||||
@@ -32,11 +33,11 @@ def get_sign(*args):
|
||||
return sign
|
||||
|
||||
def load_yaml_file(yaml_file):
|
||||
with open(yaml_file, 'r+', encoding='utf-8') as stream:
|
||||
with codecs.open(yaml_file, 'r+', encoding='utf-8') as stream:
|
||||
return yaml.load(stream)
|
||||
|
||||
def load_json_file(json_file):
|
||||
with open(json_file, encoding='utf-8') as data_file:
|
||||
with codecs.open(json_file, encoding='utf-8') as data_file:
|
||||
return json.load(data_file)
|
||||
|
||||
def load_testcases(testcase_file_path):
|
||||
|
||||
Reference in New Issue
Block a user