summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/conf.py21
-rw-r--r--jsonschema/_validators.py16
-rw-r--r--jsonschema/tests/test_jsonschema_test_suite.py13
-rw-r--r--tox.ini2
4 files changed, 30 insertions, 22 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 73e0e1f..2b9637f 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -11,13 +11,14 @@ import jsonschema
ext_paths = [os.path.abspath(os.path.pardir), os.path.dirname(__file__)]
sys.path = ext_paths + sys.path
-# -- General configuration -----------------------------------------------------
+# -- General configuration -------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = "1.0"
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named "sphinx.ext.*") or your custom ones.
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named "sphinx.ext.*") or your custom
+# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
@@ -68,7 +69,7 @@ version = release.partition("-")[0]
# directories to ignore when looking for source files.
exclude_patterns = ["_build", "_cache", "_static", "_templates"]
-# The reST default role (used for this markup: `text`) to use for all documents.
+# The reST default role (used for this markup: `text`) to use for all documents
default_role = "any"
# The name of the Pygments (syntax highlighting) style to use.
@@ -88,7 +89,7 @@ intersphinx_mapping = {
}
-# -- Options for HTML output ---------------------------------------------------
+# -- Options for HTML output -----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
@@ -168,10 +169,10 @@ html_theme = "pyramid"
htmlhelp_basename = "jsonschemadoc"
-# -- Options for LaTeX output --------------------------------------------------
+# -- Options for LaTeX output ----------------------------------------------
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
+# Grouping the document tree into LaTeX files. List of tuples (source
+# start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
("index", "jsonschema.tex", u"jsonschema Documentation", author, "manual"),
]
@@ -197,7 +198,7 @@ latex_documents = [
# latex_domain_indices = True
-# -- Options for manual page output --------------------------------------------
+# -- Options for manual page output ----------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
@@ -207,7 +208,7 @@ man_pages = [("index", "jsonschema", u"jsonschema Documentation", [author], 1)]
# man_show_urls = False
-# -- Options for Texinfo output ------------------------------------------------
+# -- Options for Texinfo output --------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
diff --git a/jsonschema/_validators.py b/jsonschema/_validators.py
index 7e8c95a..0f7b6fb 100644
--- a/jsonschema/_validators.py
+++ b/jsonschema/_validators.py
@@ -170,14 +170,16 @@ def multipleOf(validator, dB, instance, schema):
try:
failed = int(quotient) != quotient
except OverflowError:
- # When `instance` is large and `dB` is less than one, quotient can
- # overflow to infinity; and then casting to int raises an error.
+ # When `instance` is large and `dB` is less than one,
+ # quotient can overflow to infinity; and then casting to int
+ # raises an error.
#
- # In this case we fall back to Fraction logic, which is exact and
- # cannot overflow. The performance is also acceptable: we try the
- # fast all-float option first, and we know that fraction(dB) can have
- # at most a few hundred digits in each part. The worst-case slowdown
- # is therefore for already-slow enormous integers or Decimals.
+ # In this case we fall back to Fraction logic, which is
+ # exact and cannot overflow. The performance is also
+ # acceptable: we try the fast all-float option first, and
+ # we know that fraction(dB) can have at most a few hundred
+ # digits in each part. The worst-case slowdown is therefore
+ # for already-slow enormous integers or Decimals.
failed = (Fraction(instance) / Fraction(dB)).denominator != 1
else:
failed = instance % dB
diff --git a/jsonschema/tests/test_jsonschema_test_suite.py b/jsonschema/tests/test_jsonschema_test_suite.py
index 0f9698a..d4b4720 100644
--- a/jsonschema/tests/test_jsonschema_test_suite.py
+++ b/jsonschema/tests/test_jsonschema_test_suite.py
@@ -77,7 +77,9 @@ if is_narrow_build: # pragma: no cover
def narrow_unicode_build(test): # pragma: no cover
return skip(
message=message,
- description="one supplementary Unicode code point is not long enough",
+ description=(
+ "one supplementary Unicode code point is not long enough"
+ ),
)(test) or skip(
message=message,
description="two supplementary Unicode code points is long enough",
@@ -191,7 +193,8 @@ TestDraft4 = DRAFT4.to_unittest_testcase(
message=bug(371),
subject="ref",
case_description=(
- "Location-independent identifier with base URI change in subschema"
+ "Location-independent identifier with "
+ "base URI change in subschema"
),
)(test)
or skip(
@@ -271,7 +274,8 @@ TestDraft6 = DRAFT6.to_unittest_testcase(
message=bug(371),
subject="ref",
case_description=(
- "Location-independent identifier with base URI change in subschema"
+ "Location-independent identifier with "
+ "base URI change in subschema"
),
)(test)
or skip(
@@ -372,7 +376,8 @@ TestDraft7 = DRAFT7.to_unittest_testcase(
message=bug(371),
subject="ref",
case_description=(
- "Location-independent identifier with base URI change in subschema"
+ "Location-independent identifier with "
+ "base URI change in subschema"
),
)(test)
or skip(
diff --git a/tox.ini b/tox.ini
index fb455bd..fbd59eb 100644
--- a/tox.ini
+++ b/tox.ini
@@ -75,7 +75,7 @@ commands = {envbindir}/detect-secrets scan {toxinidir}
[testenv:style]
basepython = pypy3
deps =
- ebb-lint>=0.19.1.0
+ flake8
commands =
{envpython} -m flake8 {posargs} {toxinidir}/jsonschema {toxinidir}/docs