diff options
author | Julian Berman <Julian@GrayVines.com> | 2022-08-18 14:03:22 +0300 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2022-08-18 14:03:22 +0300 |
commit | edaf2a19c4a4915928cfe4e5073abb0f10321c59 (patch) | |
tree | cdab28f42f36636c365c6a6ee668316f9608d705 | |
parent | dfd41e84c5469352f79d14f0cc4539fc7bd1d8f7 (diff) | |
download | jsonschema-edaf2a19c4a4915928cfe4e5073abb0f10321c59.tar.gz |
Remove some old unnecessary explicit object superclasses.
-rw-r--r-- | docs/validate.rst | 2 | ||||
-rw-r--r-- | jsonschema/_format.py | 2 | ||||
-rw-r--r-- | jsonschema/_types.py | 2 | ||||
-rw-r--r-- | jsonschema/_utils.py | 2 | ||||
-rw-r--r-- | jsonschema/cli.py | 6 | ||||
-rw-r--r-- | jsonschema/exceptions.py | 2 | ||||
-rw-r--r-- | jsonschema/tests/_suite.py | 6 | ||||
-rw-r--r-- | jsonschema/tests/test_cli.py | 2 | ||||
-rw-r--r-- | jsonschema/tests/test_exceptions.py | 2 | ||||
-rw-r--r-- | jsonschema/tests/test_validators.py | 10 | ||||
-rw-r--r-- | jsonschema/validators.py | 2 |
11 files changed, 19 insertions, 19 deletions
diff --git a/docs/validate.rst b/docs/validate.rst index a3eebd7..a343b30 100644 --- a/docs/validate.rst +++ b/docs/validate.rst @@ -88,7 +88,7 @@ existing `TypeChecker` or create a new one. You may then create a new from jsonschema import validators - class MyInteger(object): + class MyInteger: pass def is_my_int(checker, instance): diff --git a/jsonschema/_format.py b/jsonschema/_format.py index da4bb79..f687b74 100644 --- a/jsonschema/_format.py +++ b/jsonschema/_format.py @@ -16,7 +16,7 @@ _RaisesType = typing.Union[ ] -class FormatChecker(object): +class FormatChecker: """ A ``format`` property checker. diff --git a/jsonschema/_types.py b/jsonschema/_types.py index 9d59eb3..e858290 100644 --- a/jsonschema/_types.py +++ b/jsonschema/_types.py @@ -67,7 +67,7 @@ def is_any(checker, instance): @attr.s(frozen=True) -class TypeChecker(object): +class TypeChecker: """ A ``type`` property checker. diff --git a/jsonschema/_utils.py b/jsonschema/_utils.py index 7e11325..418348c 100644 --- a/jsonschema/_utils.py +++ b/jsonschema/_utils.py @@ -43,7 +43,7 @@ class URIDict(MutableMapping): return repr(self.store) -class Unset(object): +class Unset: """ An as-of-yet unset attribute or unprovided default parameter. """ diff --git a/jsonschema/cli.py b/jsonschema/cli.py index f19b680..9f75752 100644 --- a/jsonschema/cli.py +++ b/jsonschema/cli.py @@ -30,7 +30,7 @@ class _CannotLoadFile(Exception): @attr.s -class _Outputter(object): +class _Outputter: _formatter = attr.ib() _stdout = attr.ib() @@ -72,7 +72,7 @@ class _Outputter(object): @attr.s -class _PrettyFormatter(object): +class _PrettyFormatter: _ERROR_MSG = dedent( """\ @@ -114,7 +114,7 @@ class _PrettyFormatter(object): @attr.s -class _PlainFormatter(object): +class _PlainFormatter: _error_format = attr.ib() diff --git a/jsonschema/exceptions.py b/jsonschema/exceptions.py index d1351c4..bb66950 100644 --- a/jsonschema/exceptions.py +++ b/jsonschema/exceptions.py @@ -237,7 +237,7 @@ class FormatError(Exception): return self.message -class ErrorTree(object): +class ErrorTree: """ ErrorTrees make it easier to check which validations failed. """ diff --git a/jsonschema/tests/_suite.py b/jsonschema/tests/_suite.py index a2148ba..0ee72b7 100644 --- a/jsonschema/tests/_suite.py +++ b/jsonschema/tests/_suite.py @@ -36,7 +36,7 @@ def _find_suite(): @attr.s(hash=True) -class Suite(object): +class Suite: _root = attr.ib(default=attr.Factory(_find_suite)) @@ -63,7 +63,7 @@ class Suite(object): @attr.s(hash=True) -class Version(object): +class Version: _path = attr.ib() _remotes = attr.ib() @@ -140,7 +140,7 @@ class Version(object): @attr.s(hash=True, repr=False) -class _Test(object): +class _Test: version = attr.ib() diff --git a/jsonschema/tests/test_cli.py b/jsonschema/tests/test_cli.py index b0e08c4..b4b59f7 100644 --- a/jsonschema/tests/test_cli.py +++ b/jsonschema/tests/test_cli.py @@ -29,7 +29,7 @@ from jsonschema.validators import _LATEST_VERSION, validate def fake_validator(*errors): errors = list(reversed(errors)) - class FakeValidator(object): + class FakeValidator: def __init__(self, *args, **kwargs): pass diff --git a/jsonschema/tests/test_exceptions.py b/jsonschema/tests/test_exceptions.py index 521f445..d7b9deb 100644 --- a/jsonschema/tests/test_exceptions.py +++ b/jsonschema/tests/test_exceptions.py @@ -563,7 +563,7 @@ class TestErrorInitReprStr(TestCase): that returned truthy values. """ - class DontEQMeBro(object): + class DontEQMeBro: def __eq__(this, other): # pragma: no cover self.fail("Don't!") diff --git a/jsonschema/tests/test_validators.py b/jsonschema/tests/test_validators.py index e4f60ea..d49dba0 100644 --- a/jsonschema/tests/test_validators.py +++ b/jsonschema/tests/test_validators.py @@ -1406,7 +1406,7 @@ class TestValidationErrorDetails(TestCase): ) -class MetaSchemaTestsMixin(object): +class MetaSchemaTestsMixin: # TODO: These all belong upstream def test_invalid_properties(self): with self.assertRaises(exceptions.SchemaError): @@ -1504,7 +1504,7 @@ class ValidatorTestMixin(MetaSchemaTestsMixin, object): resolution. """ - class LegacyRefResolver(object): + class LegacyRefResolver: @contextmanager def resolving(this, ref): self.assertEqual(ref, "the ref") @@ -1677,7 +1677,7 @@ class ValidatorTestMixin(MetaSchemaTestsMixin, object): validator.validate(instance) -class AntiDraft6LeakMixin(object): +class AntiDraft6LeakMixin: """ Make sure functionality from draft 6 doesn't leak backwards in time. """ @@ -2202,7 +2202,7 @@ def sorted_errors(errors): @attr.s -class ReallyFakeRequests(object): +class ReallyFakeRequests: _responses = attr.ib() @@ -2214,7 +2214,7 @@ class ReallyFakeRequests(object): @attr.s -class _ReallyFakeJSONResponse(object): +class _ReallyFakeJSONResponse: _response = attr.ib() diff --git a/jsonschema/validators.py b/jsonschema/validators.py index e6d5370..abdcb4c 100644 --- a/jsonschema/validators.py +++ b/jsonschema/validators.py @@ -662,7 +662,7 @@ Draft202012Validator = create( _LATEST_VERSION = Draft202012Validator -class RefResolver(object): +class RefResolver: """ Resolve JSON References. |