mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-13 17:29:56 +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
|
||||
|
||||
## 2.5.1 (2020-01-02)
|
||||
|
||||
**Fixed**
|
||||
|
||||
- fix: RefResolutionError on Windows platform
|
||||
|
||||
## 2.5.0 (2020-01-01)
|
||||
|
||||
**Added**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
__version__ = "2.5.0"
|
||||
__version__ = "2.5.1"
|
||||
__description__ = "One-stop solution for HTTP(S) testing."
|
||||
|
||||
__all__ = ["__version__", "__description__"]
|
||||
|
||||
@@ -56,7 +56,7 @@ def main():
|
||||
help="Specify new project name.")
|
||||
parser.add_argument(
|
||||
'--validate', nargs='*',
|
||||
help="Validate JSON testcase format.")
|
||||
help="Validate YAML/JSON api/testcase/testsuite format.")
|
||||
parser.add_argument(
|
||||
'--prettify', nargs='*',
|
||||
help="Prettify JSON testcase format.")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
|
||||
import jsonschema
|
||||
|
||||
@@ -17,8 +18,14 @@ with open(api_schema_path) as f:
|
||||
api_schema = json.load(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)
|
||||
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:
|
||||
testcase_schema_v1 = json.load(f)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "httprunner"
|
||||
version = "2.5.0"
|
||||
version = "2.5.1"
|
||||
description = "One-stop solution for HTTP(S) testing."
|
||||
license = "Apache-2.0"
|
||||
readme = "README.md"
|
||||
|
||||
Reference in New Issue
Block a user