summaryrefslogtreecommitdiff
path: root/jsonschema
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-12-26 10:36:03 -0500
committerJulian Berman <Julian@GrayVines.com>2022-12-26 10:36:03 -0500
commitc175f9d3187f8ceaf397b106edc174813ddd079f (patch)
tree52c5864e2452cadd395e381b9f1934c43316bbe3 /jsonschema
parent028b6f0f9283aa552701d0fad48b0e9082f18063 (diff)
downloadjsonschema-c175f9d3187f8ceaf397b106edc174813ddd079f.tar.gz
Minor spelling and style.
Diffstat (limited to 'jsonschema')
-rw-r--r--jsonschema/cli.py9
-rw-r--r--jsonschema/tests/test_cli.py2
2 files changed, 6 insertions, 5 deletions
diff --git a/jsonschema/cli.py b/jsonschema/cli.py
index f93b5c5..1292b1a 100644
--- a/jsonschema/cli.py
+++ b/jsonschema/cli.py
@@ -251,11 +251,12 @@ def run(arguments, stdout=sys.stdout, stderr=sys.stderr, stdin=sys.stdin):
except _CannotLoadFile:
return 1
- if arguments["validator"] is None:
- arguments["validator"] = validator_for(schema)
+ Validator = arguments["validator"]
+ if Validator is None:
+ Validator = validator_for(schema)
try:
- arguments["validator"].check_schema(schema)
+ Validator.check_schema(schema)
except SchemaError as error:
outputter.validation_error(
instance_path=arguments["schema"],
@@ -281,7 +282,7 @@ def run(arguments, stdout=sys.stdout, stderr=sys.stderr, stdin=sys.stdin):
referrer=schema,
) if arguments["base_uri"] is not None else None
- validator = arguments["validator"](schema, resolver=resolver)
+ validator = Validator(schema, resolver=resolver)
exit_code = 0
for each in instances:
try:
diff --git a/jsonschema/tests/test_cli.py b/jsonschema/tests/test_cli.py
index 9011a76..64f77b0 100644
--- a/jsonschema/tests/test_cli.py
+++ b/jsonschema/tests/test_cli.py
@@ -762,7 +762,7 @@ class TestCLI(TestCase):
error = str(e.exception)
self.assertIn(f"{os.sep}someNonexistentFile.json'", error)
- def test_invalid_exlicit_base_uri(self):
+ def test_invalid_explicit_base_uri(self):
schema = '{"$ref": "foo.json#definitions/num"}'
instance = "1"