This project is another implementation of the "Projeto-LuizaCode" from my friend @anairotiv.
It consists of an API written in Python language that makes CRUD of a cart that contains User, Product, Cart and Cart-Items Schemas and uses FastAPI with MongoDB
fastapi[all] = Fastapi Python framework with it´s aditional modules: requests and uvicorn used in this project
$ git clone https://github.com/LeandroLFE/Projeto-LuizaCode.git
$ cd Projeto-LuizaCode
DATABASE_URI = <your_mongodb_atlas_connection_string>
$ python -m venv venv
$ .\venv\Scripts\activate (Windows)
$ source venv/bin/activate (Linux)
$ pip install -r requirements.txt
$ uvicorn main:app
Open http://127.0.0.1:8000/docs or use the http_tests folder with the VSCode extension "Rest Client" to send requisitions
$ pytest
[run]
omit = tests/*, main.py
$ pytest --cov-config=.coveragerc --cov-report xml:{your_coverage_location}\cov.xml --cov-report term --cov=. tests/
- it will execute pytest, store the coverage report in cov.xml file, and show the result table in terminal
- You can use the VSCode "Coverage Gutters" extension to show coverage in each python file in project