Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .idea/runConfigurations/Flask.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/runConfigurations/pytest_in__.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ clean:

.PHONY: pre-commit
pre-commit:
pre-commit install
poetry run pre-commit install

.PHONY: bump-check
bump-check:
Expand Down
436 changes: 131 additions & 305 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ packages = [{include = "testrepo", from = "src"}]

[tool.poetry.dependencies]
python = "^3.12 <3.13"
quart = "^0.19.6"
hypercorn = {extras = ["uvloop"], version = "^0.17.3"}
flask = "^3.0.3"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.1"
pytest-cov = "^5.0.0"
pytest-mypy = "^0.10.3"
pytest-asyncio = "^0.23.8"
pre-commit = "^3.7.1"

[build-system]
Expand Down
12 changes: 6 additions & 6 deletions src/testrepo/app.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import logging

from quart import Quart, jsonify, make_response
from quart.typing import ResponseTypes
from flask import Flask, jsonify, make_response
from flask.wrappers import Response

from testrepo import __version__


def load() -> Quart:
app = Quart(__name__, static_folder=None)
def load() -> Flask:
app = Flask(__name__, static_folder=None)
app.config.from_prefixed_env("TEST")
app.logger.info("starting web application version %s", __version__)

@app.route("/")
async def health() -> ResponseTypes:
return await make_response(
def health() -> Response:
return make_response(
jsonify({
"status": "pass",
"message": "flux capacitor is fluxing",
Expand Down
File renamed without changes.
9 changes: 3 additions & 6 deletions tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import pytest

from testrepo.app import load


@pytest.mark.asyncio
async def test_health_route():
def test_health_route():
app = load()
test_client = app.test_client()
response = await test_client.get("/")
response = test_client.get("/")
assert response.status_code == 200
json_data = await response.get_json()
json_data = response.get_json()
assert json_data == {
"status": "pass",
"message": "flux capacitor is fluxing",
Expand Down