[pre-commit.ci lite] apply automatic fixes

This commit is contained in:
pre-commit-ci-lite[bot] 2025-02-15 02:41:00 +00:00 committed by GitHub
parent 1e3bbb898a
commit f8e512157c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,18 +1,31 @@
import pytest
from flask import template_rendered
@pytest.mark.parametrize(('path', 'template_name'), (('/', 'fetch.html'), ('/plain', 'xhr.html'), ('/fetch', 'fetch.html'), ('/jquery', 'jquery.html')))
@pytest.mark.parametrize(
("path", "template_name"),
(
("/", "fetch.html"),
("/plain", "xhr.html"),
("/fetch", "fetch.html"),
("/jquery", "jquery.html"),
),
)
def test_index(app, client, path, template_name):
"""Auto-generated docstring for function test_index."""
def check(sender, template, context):
"""Auto-generated docstring for function check."""
assert template.name == template_name
with template_rendered.connected_to(check, app):
client.get(path)
@pytest.mark.parametrize(('a', 'b', 'result'), ((2, 3, 5), (2.5, 3, 5.5), (2, None, 2), (2, 'b', 2)))
@pytest.mark.parametrize(
("a", "b", "result"), ((2, 3, 5), (2.5, 3, 5.5), (2, None, 2), (2, "b", 2))
)
def test_add(client, a, b, result):
"""Auto-generated docstring for function test_add."""
response = client.post('/add', data={'a': a, 'b': b})
assert response.get_json()['result'] == result
response = client.post("/add", data={"a": a, "b": b})
assert response.get_json()["result"] == result