Skip to content

Commit f6fb166

Browse files
committed
Pending changes exported from your codespace
1 parent fcc6a2f commit f6fb166

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

Diff for: README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ To run the Flask application, follow these steps:
4646
4747
### Run the tests
4848
49-
1. **Inside your virtual environment, execute the following command to run the tests**
49+
1. **Inside your virtual environment, execute the following command to install the development requirements:**
50+
51+
```bash
52+
pip install -r requirements-dev.txt
53+
```
54+
55+
1. **Execute the following command to run the tests**
5056
5157
```bash
5258
python flask_test.py

Diff for: pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extend-exclude = "src/flaskapp/migrations/"
1515

1616
[tool.pytest.ini_options]
1717
addopts = "-ra --cov"
18+
testpaths = ["tests"]
1819
pythonpath = ["src"]
1920

2021
[tool.coverage.report]

Diff for: flask_test.py renamed to tests/flask_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import unittest
44

5-
from src.app import create_app
5+
from flaskapp import create_app
66

77

88
class TestCaseManagementTestCase(unittest.TestCase):

Diff for: tests/test_gunicorn.py

+15
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)