https://github.com/pytest-with-eric/pytest-flask-sqlalchemy-example
3 Proven Ways To Test Your Flask Applications With Pytest
https://github.com/pytest-with-eric/pytest-flask-sqlalchemy-example
pytest-flask pytest-mock-assert-called pytest-mocking pytest-postgresql pytest-sqlalchemy
Last synced: 9 months ago
JSON representation
3 Proven Ways To Test Your Flask Applications With Pytest
- Host: GitHub
- URL: https://github.com/pytest-with-eric/pytest-flask-sqlalchemy-example
- Owner: Pytest-with-Eric
- Created: 2024-07-17T07:53:04.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-24T09:51:17.000Z (over 1 year ago)
- Last Synced: 2025-01-29T12:29:35.486Z (11 months ago)
- Topics: pytest-flask, pytest-mock-assert-called, pytest-mocking, pytest-postgresql, pytest-sqlalchemy
- Language: Python
- Homepage: https://pytest-with-eric.com/api-testing/pytest-flask-postgresql-testing/
- Size: 38.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pytest Flask SQLAlchemy Example
## Description
This repository contains the example code for the article series on [3 Proven Ways To Test Your Flask Applications With Pytest](https://pytest-with-eric.com/api-testing/pytest-flask-postgresql-testing/)
## Installation
To install the project, you need to have Poetry installed. If you don't have it installed, you can install it by following the instructions [here](https://python-poetry.org/docs/#installation).
## Requirements
- Python 3.12
- Poetry
## Usage
### How To Run the Server
To run the server, use the following command:
```shell
$ poetry run python user_manager/app.py
```
This will spin up the server at `http://localhost:5000`
### How To Run the Tests
To run the tests, use the following command:
```shell
$ poetry run pytest
$ poetry run pytest --dburl=postgresql://myuser:mypassword@localhost:5433/mydatabase_test
```
Please follow further instructions on how to run the app in the [blog post](https://pytest-with-eric.com/api-testing/pytest-flask-postgresql-testing/).
If you have any questions about the project please raise an Issue on GitHub.