mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-06 23:11:21 +08:00
Merge pull request #833 from httprunner/leo_dev
2.5.1 **Fixed** - fix: RefResolutionError on Windows platform
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# Release History
|
# Release History
|
||||||
|
|
||||||
|
## 2.5.1 (2020-01-02)
|
||||||
|
|
||||||
|
**Fixed**
|
||||||
|
|
||||||
|
- fix: RefResolutionError on Windows platform
|
||||||
|
|
||||||
## 2.5.0 (2020-01-01)
|
## 2.5.0 (2020-01-01)
|
||||||
|
|
||||||
**Added**
|
**Added**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
__version__ = "2.5.0"
|
__version__ = "2.5.1"
|
||||||
__description__ = "One-stop solution for HTTP(S) testing."
|
__description__ = "One-stop solution for HTTP(S) testing."
|
||||||
|
|
||||||
__all__ = ["__version__", "__description__"]
|
__all__ = ["__version__", "__description__"]
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ def main():
|
|||||||
help="Specify new project name.")
|
help="Specify new project name.")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--validate', nargs='*',
|
'--validate', nargs='*',
|
||||||
help="Validate JSON testcase format.")
|
help="Validate YAML/JSON api/testcase/testsuite format.")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--prettify', nargs='*',
|
'--prettify', nargs='*',
|
||||||
help="Prettify JSON testcase format.")
|
help="Prettify JSON testcase format.")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
|
|
||||||
@@ -17,8 +18,14 @@ with open(api_schema_path) as f:
|
|||||||
api_schema = json.load(f)
|
api_schema = json.load(f)
|
||||||
|
|
||||||
with open(common_schema_path) as f:
|
with open(common_schema_path) as f:
|
||||||
|
if platform.system() == "Windows":
|
||||||
|
absolute_base_path = 'file:///' + os.path.abspath(schemas_root_dir).replace("\\", "/") + '/'
|
||||||
|
else:
|
||||||
|
# Linux, Darwin
|
||||||
|
absolute_base_path = "file://" + os.path.abspath(schemas_root_dir) + "/"
|
||||||
|
|
||||||
common_schema = json.load(f)
|
common_schema = json.load(f)
|
||||||
resolver = jsonschema.RefResolver("file://{}/".format(os.path.abspath(schemas_root_dir)), common_schema)
|
resolver = jsonschema.RefResolver(absolute_base_path, common_schema)
|
||||||
|
|
||||||
with open(testcase_schema_v1_path) as f:
|
with open(testcase_schema_v1_path) as f:
|
||||||
testcase_schema_v1 = json.load(f)
|
testcase_schema_v1 = json.load(f)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "httprunner"
|
name = "httprunner"
|
||||||
version = "2.5.0"
|
version = "2.5.1"
|
||||||
description = "One-stop solution for HTTP(S) testing."
|
description = "One-stop solution for HTTP(S) testing."
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
Reference in New Issue
Block a user