https://github.com/carrington-dev/flask-unit-test-2
Building and testing flask API systems
https://github.com/carrington-dev/flask-unit-test-2
Last synced: about 1 year ago
JSON representation
Building and testing flask API systems
- Host: GitHub
- URL: https://github.com/carrington-dev/flask-unit-test-2
- Owner: Carrington-dev
- License: mit
- Created: 2025-02-28T07:02:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-28T08:14:51.000Z (over 1 year ago)
- Last Synced: 2025-02-28T14:25:28.484Z (over 1 year ago)
- Language: Python
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Flask Unit Testing
## Overview
This project demonstrates how to write unit tests for a Flask application using `unittest` and `pytest`. The repository contains a simple Flask app and test cases to ensure its functionality.
## Features
- Flask app with basic routes
- Unit testing using `unittest` and `pytest`
- Test coverage for different scenarios
## Requirements
Ensure you have the following installed:
- Python 3.7+
- Flask
- pytest
- unittest
You can install the dependencies using:
```sh
pip install -r requirements.txt
```
## Project Structure
```
flask-unit-test-2/
│-- app.py # Main Flask application
│-- test_app.py # Unit tests for Flask app
│-- requirements.txt # Dependencies
│-- README.md # Project documentation
```
## Running the Flask App
To start the Flask application, run:
```sh
python app.py
```
## Running Unit Tests
You can run the unit tests using `unittest`:
```sh
python -m unittest discover
```
Or using `pytest`:
```sh
pytest
```
## Contributing
Feel free to fork this repository and submit pull requests to improve the unit tests.
## License
This project is licensed under the MIT License.