You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Works fine on python2.7, but with python 3.4 got this stacktrace :
Traceback (most recent call last):
File "/usr/local/bin/resttest.py", line 4, in <module>
resttest.command_line_run(sys.argv[1:])
File "/usr/local/lib/python3.4/dist-packages/pyresttest/resttest.py", line 911, in command_line_run
main(args)
File "/usr/local/lib/python3.4/dist-packages/pyresttest/resttest.py", line 853, in main
failures = run_testsets(tests)
File "/usr/local/lib/python3.4/dist-packages/pyresttest/resttest.py", line 654, in run_testsets
result = run_test(test, test_config=myconfig, context=context, curl_handle=curl_handle)
File "/usr/local/lib/python3.4/dist-packages/pyresttest/resttest.py", line 409, in run_test
body=body, headers=head, context=my_context)
File "/usr/local/lib/python3.4/dist-packages/pyresttest/ext/validator_jsonschema.py", line 30, in validate
jsonschema.validate(json.loads(body), schema)
File "/usr/lib/python3.4/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
The text was updated successfully, but these errors were encountered:
b4nst
changed the title
Jsonschema with python3
Jsonschema validator with python3
Mar 14, 2016
Hi @bastienar -
Thank you for reporting the issue - I've fixed the bug, added a testcase to cover it, verified it against the environments, and released it to the public. You have, of course, received credit in the changelog for spotting this. ;)
v1.7.1 includes the fix (also on the master & stable brancesh if you're cloning from source).
When validated extracted data against a json schema file with this kind of test :
Works fine on python2.7, but with python 3.4 got this stacktrace :
The text was updated successfully, but these errors were encountered: