Skip to content

Commit 3618c15

Browse files
committed
Cruft update
1 parent 46d1b91 commit 3618c15

File tree

11 files changed

+115
-9
lines changed

11 files changed

+115
-9
lines changed

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"template": "https://github.com/kjaymiller/cookiecutter-relecloud",
3-
"commit": "f86115e94dda2639d5678dad3a3232bacf583af2",
4-
"checkout": "picklefix",
3+
"commit": "c8fa43e87b3fa4fafa5a1a718e3f81d377865247",
4+
"checkout": null,
55
"context": {
66
"cookiecutter": {
77
"project_name": "azure",

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"files.exclude": {
3333
".coverage": true,
3434
".pytest_cache": true,
35-
"__pycache__": true
35+
"__pycache__": true,
36+
".ruff_cache": true
3637
},
3738
"[python]": {
3839
"editor.formatOnSave": true,

.github/workflows/azure-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,5 @@ jobs:
103103
run: |
104104
python3 -m pip install --upgrade pip
105105
python3 -m pip install -r requirements-dev.txt
106-
python3 -m playwright install --with-deps
106+
python3 -m playwright install chromium --with-deps
107107
python3 -m pytest --exitfirst src/tests/smoke/smoketests.py --live-server-url $URI

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: |
3838
python3 -m pip install --upgrade pip
3939
python3 -m pip install -r requirements-dev.txt
40-
playwright install --with-deps
40+
playwright install chromium --with-deps
4141
python3 -m pip install -e src
4242
- name: Seed data and run Pytest tests
4343
run: |

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
],
2222
"jinja": true,
2323
"justMyCode": false
24+
},
25+
{
26+
"name": "Python: Debug Tests",
27+
"type": "python",
28+
"request": "launch",
29+
"program": "${file}",
30+
"purpose": ["debug-test"],
31+
"console": "integratedTerminal",
32+
"env": {"PYTEST_ADDOPTS": "--no-cov"}
2433
}
2534
]
2635
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export POSTGRES_PASSWORD=<YOUR PASSWORD>
4646
If you're running the app inside VS Code or GitHub Codespaces, you can use the "Run and Debug" button to start the app.
4747
4848
```sh
49-
python3 -m flask --app src.flaskapp run --reload --port=8000
49+
python3 -m flask --app src.flaskapp run --debug --reload --port=8000
5050
```
5151
5252
@@ -56,7 +56,7 @@ python3 -m flask --app src.flaskapp run --reload --port=8000
5656
5757
```sh
5858
python3 -m pip install -r requirements-dev.txt
59-
python3 -m playwright install --with-deps
59+
python3 -m playwright install chromium --with-deps
6060
```
6161
6262
3. Run the tests:

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ known-first-party = ["flaskapp"]
99

1010
[tool.pytest.ini_options]
1111
addopts = "-ra -vv"
12+
13+
[tool.coverage.report]
14+
show_missing = true

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ pip-tools
88
pytest
99
ephemeral-port-reserve
1010
pytest-playwright
11+
coverage
12+
pytest-cov
1113

1214
# Linters
1315
ruff

src/flaskapp/pages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ def cruise_detail(pk: int):
4444
)
4545

4646

47-
@bp.get("/info_request/")
47+
@bp.get("/info_request")
4848
def info_request():
4949
all_cruises = db.session.execute(db.select(models.Cruise)).scalars().all()
5050

5151
return render_template("info_request_create.html", cruises=all_cruises, message=request.args.get("message"))
5252

5353

54-
@bp.post("/info_request/")
54+
@bp.post("/info_request")
5555
def create_info_request():
5656
name = request.form["name"]
5757
db_info_request = models.InfoRequest(

src/tests/local/test_gunicorn.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sys
2+
from unittest import mock
3+
4+
import pytest
5+
from gunicorn.app.wsgiapp import run
6+
7+
8+
def test_config_imports():
9+
argv = ["gunicorn", "--check-config", "flaskapp:create_app()", "-c", "src/gunicorn.conf.py"]
10+
11+
with mock.patch.object(sys, "argv", argv):
12+
with pytest.raises(SystemExit) as excinfo:
13+
run()
14+
15+
assert excinfo.value.args[0] == 0

0 commit comments

Comments
 (0)