Skip to content

Commit

Permalink
pre-commit: Bump plugin versions
Browse files Browse the repository at this point in the history
These are all rather out-of-date and not compatible with the default
Python version on my system (Python 3.11).

Signed-off-by: Stephen Finucane <[email protected]>
  • Loading branch information
stephenfin committed Dec 6, 2022
1 parent ce45352 commit 3150135
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 15 deletions.
9 changes: 4 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -10,7 +10,7 @@ repos:
- id: debug-statements

- repo: https://github.com/psf/black
rev: 19.10b0
rev: 22.10.0
hooks:
- id: black
args: [--line-length=88, --target-version=py35]
Expand Down Expand Up @@ -41,8 +41,7 @@ repos:
| tests/test_spec_examples.py
)
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: [--max-line-length=99]
3 changes: 2 additions & 1 deletion tests/renderers/httpdomain/test_render_request_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def test_render_request_body_schema_description_turned_off(fakestate, oas_fragme
"""JSON schema description is not rendered b/c feature is off."""

testrenderer = renderers.HttpdomainRenderer(
fakestate, {"no-json-schema-description": True},
fakestate,
{"no-json-schema-description": True},
)

markup = textify(
Expand Down
24 changes: 18 additions & 6 deletions tests/renderers/httpdomain/test_render_request_body_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def test_render_request_body_example(testrenderer, content, oas_fragment):

markup = textify(
testrenderer.render_request_body_example(
oas_fragment(content), "/evidences/{evidenceId}", "POST",
oas_fragment(content),
"/evidences/{evidenceId}",
"POST",
)
)
assert markup == textwrap.dedent(
Expand Down Expand Up @@ -397,7 +399,9 @@ def test_render_request_body_example_external_errored_next_example(
"""Request body's example fallbacks on next when external cannot be retrieved."""

responses.add(
responses.GET, "https://example.com/json/examples/test.json", status=404,
responses.GET,
"https://example.com/json/examples/test.json",
status=404,
)

markup = textify(
Expand Down Expand Up @@ -431,12 +435,16 @@ def test_render_request_body_example_external_errored_next_example(

@responses.activate
def test_render_request_body_example_external_errored_next_media_type(
testrenderer, oas_fragment, caplog,
testrenderer,
oas_fragment,
caplog,
):
"""Request body's example fallbacks on next when external cannot be retrieved."""

responses.add(
responses.GET, "https://example.com/json/examples/test.json", status=404,
responses.GET,
"https://example.com/json/examples/test.json",
status=404,
)

markup = textify(
Expand Down Expand Up @@ -524,7 +532,9 @@ def test_render_request_body_example_noop(testrenderer, oas_fragment):
["http_method"], [pytest.param("POST"), pytest.param("PUT"), pytest.param("PATCH")]
)
def test_render_request_body_example_http_method(
testrenderer, oas_fragment, http_method,
testrenderer,
oas_fragment,
http_method,
):
"""Request body's example shows proper HTTP method."""

Expand Down Expand Up @@ -562,7 +572,9 @@ def test_render_request_body_example_http_method(
[pytest.param("/evidences/{evidenceId}"), pytest.param("/heroes/{heroId}")],
)
def test_render_request_body_example_http_endpoint(
testrenderer, oas_fragment, http_endpoint,
testrenderer,
oas_fragment,
http_endpoint,
):
"""Request body's example shows proper HTTP method."""

Expand Down
8 changes: 6 additions & 2 deletions tests/renderers/httpdomain/test_render_response_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ def test_render_response_example_external_errored_next_example(
"""Path response's example fallbacks on next when external cannot be retrieved."""

responses.add(
responses.GET, "https://example.com/json/examples/test.json", status=404,
responses.GET,
"https://example.com/json/examples/test.json",
status=404,
)

markup = textify(
Expand Down Expand Up @@ -412,7 +414,9 @@ def test_render_response_example_external_errored_next_media_type(
"""Path response's example fallbacks on next when external cannot be retrieved."""

responses.add(
responses.GET, "https://example.com/json/examples/test.json", status=404,
responses.GET,
"https://example.com/json/examples/test.json",
status=404,
)

markup = textify(
Expand Down
3 changes: 2 additions & 1 deletion tests/renderers/httpdomain/test_render_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ def test_render_responses_json_schema_description_turned_off(fakestate, oas_frag
"""JSON schema description is not rendered b/c feature is off."""

testrenderer = renderers.HttpdomainRenderer(
fakestate, {"no-json-schema-description": True},
fakestate,
{"no-json-schema-description": True},
)

markup = textify(
Expand Down
14 changes: 14 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,17 @@ commands =
[pytest]
markers =
regenerate_rendered_specs

[flake8]
# The following are ignored since they conflict with black
#
# E123 closing bracket does not match indentation of opening bracket's line
# E241 multiple spaces after ':'
# E226 missing whitespace around arithmetic operator
# W503 line break before binary operator
#
# The following are ignored since we disagree with them
#
# F541 f-string is missing placeholders
ignore = E123, E241, E226, W503, F541
max-line-length = 99

0 comments on commit 3150135

Please sign in to comment.