From 3f01e31b2ce8436b5da9ce3b82df298a641b7e18 Mon Sep 17 00:00:00 2001 From: Jiaqi Liu Date: Wed, 30 Oct 2019 15:52:32 -0500 Subject: [PATCH 1/3] syntax changes --- .travis.yml | 1 + gdcdictionary/schema_test.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 72b252abd..5e8ad9e95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: python python: - '2.7' +- '3.6' before_script: - yes | python setup.py install diff --git a/gdcdictionary/schema_test.py b/gdcdictionary/schema_test.py index 3b6f50c08..275552e40 100644 --- a/gdcdictionary/schema_test.py +++ b/gdcdictionary/schema_test.py @@ -78,7 +78,7 @@ def validate_entity(entity, schemata, project=None, name=''): def validate_schemata(schemata, metaschema): # validate schemata - print('Validating schemas against metaschema... '), + print('Validating schemas against metaschema... ') for s in schemata.values(): validate(s, metaschema) @@ -172,7 +172,7 @@ def add_system_props(self, doc): doc = json.load(f) if args.invalid: try: - print("CHECK if {0} is invalid:".format(f.name)), + print("CHECK if {0} is invalid:".format(f.name)) print(type(doc)) if type(doc) == dict: validate_entity(doc, dictionary.schema) @@ -187,7 +187,7 @@ def add_system_props(self, doc): else: raise Exception("Expected invalid, but validated.") else: - print ("CHECK if {0} is valid:".format(f.name)), + print("CHECK if {0} is valid:".format(f.name)) if type(doc) == dict: validate_entity(doc, dictionary.schema) elif type(doc) == list: From 56a9152050c7d375f2d27f1edaf0c16fe83c0d28 Mon Sep 17 00:00:00 2001 From: Jiaqi Liu Date: Wed, 30 Oct 2019 16:55:05 -0500 Subject: [PATCH 2/3] travis tests on py2 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5e8ad9e95..72b252abd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: python python: - '2.7' -- '3.6' before_script: - yes | python setup.py install From 1dc919c25f6b60b5877295772d0d8cfa2df30f4e Mon Sep 17 00:00:00 2001 From: Jiaqi Liu Date: Mon, 4 Nov 2019 16:23:01 -0600 Subject: [PATCH 3/3] chore(py3): fix print statements --- gdcdictionary/schema_test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gdcdictionary/schema_test.py b/gdcdictionary/schema_test.py index 275552e40..d5d124986 100644 --- a/gdcdictionary/schema_test.py +++ b/gdcdictionary/schema_test.py @@ -8,6 +8,7 @@ """ +from __future__ import print_function from jsonschema import validate, ValidationError import copy @@ -78,7 +79,7 @@ def validate_entity(entity, schemata, project=None, name=''): def validate_schemata(schemata, metaschema): # validate schemata - print('Validating schemas against metaschema... ') + print('Validating schemas against metaschema... ', end=" ") for s in schemata.values(): validate(s, metaschema) @@ -172,7 +173,7 @@ def add_system_props(self, doc): doc = json.load(f) if args.invalid: try: - print("CHECK if {0} is invalid:".format(f.name)) + print("CHECK if {0} is invalid:".format(f.name), end=" ") print(type(doc)) if type(doc) == dict: validate_entity(doc, dictionary.schema) @@ -187,7 +188,7 @@ def add_system_props(self, doc): else: raise Exception("Expected invalid, but validated.") else: - print("CHECK if {0} is valid:".format(f.name)) + print("CHECK if {0} is valid:".format(f.name), end=" ") if type(doc) == dict: validate_entity(doc, dictionary.schema) elif type(doc) == list: