Skip to content

lakshmi2812/Todo-Flask-Pytest-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo-Flask-Pytest-project

Overview:

A Todo REST API developed using Python and Flask and the flask-smorest extension. The API routes have been tested using POSTMAN API tests for the Todo API were developed using pytest.

Features:

REST API
Uses Marshmallow Schemas and
pytest tests to test the API and view the test results in an HTML file

Installation steps:

Clone the repository:

In the terminal, type:
git clone https://github.com/lakshmi2812/Todo-Flask-Pytest-project.git
cd Todo-Flask-Pytest-project

Pre-requisites:

Python 3.x
poetry
pip

Install the following:

pip install pipx
pipx install poetry
pip install Flask
pip install flask-smorest
pip install marshmallow pip install pytest pytest-flask pip install pytest-html

To run the app:

In the command line, type the following command: FLASK_APP=app:server flask run --reload Use an API testing tool like POSTMAN or Insomnia or any other tool of your choice and test the various API routes.

To run the pytest tests to test the API:

Go to the project root directry and make sure that the app server is running.
Now, in a separate tab, run the following command from the project root directory:
python3 -m pytest --html=report.html
The above command will run the tests and the results will be stored in a file called report.html
Open the report.html file using your favorite web browser to see the results of the API tests.

About

A Todo API developed using Python and Flask and verified using pytest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors