{"id":19874123,"url":"https://github.com/pythoninthegrass/pytest_demo","last_synced_at":"2025-06-27T10:36:43.437Z","repository":{"id":234804437,"uuid":"789532964","full_name":"pythoninthegrass/pytest_demo","owner":"pythoninthegrass","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-07T23:07:22.000Z","size":5396,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T01:25:31.575Z","etag":null,"topics":["flask","pytest","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pythoninthegrass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["pythoninthegrass"]}},"created_at":"2024-04-20T20:19:08.000Z","updated_at":"2024-04-27T03:59:29.000Z","dependencies_parsed_at":"2024-05-04T16:36:04.634Z","dependency_job_id":"20ff5165-1cd1-4f92-859c-77fc31f51e3f","html_url":"https://github.com/pythoninthegrass/pytest_demo","commit_stats":null,"previous_names":["pythoninthegrass/pytest_demo"],"tags_count":0,"template":false,"template_full_name":"pythoninthegrass/mvp","purl":"pkg:github/pythoninthegrass/pytest_demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoninthegrass%2Fpytest_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoninthegrass%2Fpytest_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoninthegrass%2Fpytest_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoninthegrass%2Fpytest_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pythoninthegrass","download_url":"https://codeload.github.com/pythoninthegrass/pytest_demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoninthegrass%2Fpytest_demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262240721,"owners_count":23280570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","pytest","python"],"created_at":"2024-11-12T16:21:51.922Z","updated_at":"2025-06-27T10:36:43.415Z","avatar_url":"https://github.com/pythoninthegrass.png","language":"Python","readme":"# pytest_demo\n\n## Summary\nThis is a demo project to show how to use\n[pytest](https://docs.pytest.org/en/8.0.x/) with a\n[flask](https://flask.palletsprojects.com/en/3.0.x/) project.\n\n**Table of Contents**\n* [pytest\\_demo](#pytest_demo)\n  * [Summary](#summary)\n  * [Setup](#setup)\n    * [Minimum requirements](#minimum-requirements)\n    * [Recommended requirements](#recommended-requirements)\n  * [Running tests](#running-tests)\n    * [Start server](#start-server)\n    * [Run test(s)](#run-tests)\n    * [Stop server](#stop-server)\n  * [Development](#development)\n    * [Makefile](#makefile)\n    * [Taskfile](#taskfile)\n  * [TODO](#todo)\n  * [Further Reading](#further-reading)\n\n## Setup\n### Minimum requirements\n* [Python 3.11](https://www.python.org/downloads/)\n* Dev dependencies\n  * make\n    * [Linux](https://www.gnu.org/software/make/)\n    * [macOS](https://www.freecodecamp.org/news/install-xcode-command-line-tools/)\n  * [editorconfig](https://editorconfig.org/)\n  * [wsl](https://docs.microsoft.com/en-us/windows/wsl/setup/environment) [Windows-only]\n\n### Recommended requirements\n* [task](https://taskfile.dev/#/installation)\n\n## Running tests\n### Start server\n```bash\n# standalone server\n./app/server.py start\n\n# taskfile\ntask serve -- start\n```\n### Run test(s)\n```bash\n# all tests\npytest\n\n# fuzzy search (can match multiple tests/files)\npytest -k app\n\n# specific file\npytest tests/unit/test_app.py\n\n# specific test\npytest tests/unit/test_app.py::test_index\n```\n### Stop server\n```bash\n# standalone server\n./app/server.py stop\n\n# taskfile\ntask serve -- stop\n```\n\n## Development\n### Makefile\n```bash\n# install all repo dependcies\nmake install\n\n# install specific repo dependencies\nmake \u003cxcode|asdf|brew|devbox|pre-commit|task\u003e\n```\n\n### Taskfile\n```bash\nλ task\ntask: [default] task --list\ntask: Available tasks for this project:\n* default:                  Default task\n* format:                   Run formatters\n* install:                  Install project dependencies\n* lint:                     Run linters\n* pre-commit:               Run pre-commit hooks\n* pyclean:                  Remove .pyc and __pycache__\n* serve:                    Run the server\n* test:                     Run tests\n* docker:build:             Build the docker image                                                     (aliases: docker:build)\n* docker:down:              Stop and remove containers, networks, and volumes with docker compose      (aliases: docker:down)\n* docker:exec:              Shell into a running container                                             (aliases: docker:exec)\n* docker:login:             Login to the container registry                                            (aliases: docker:login)\n* docker:logs:              Follow the logs of a running container                                     (aliases: docker:logs)\n* docker:net:               Create docker network                                                      (aliases: docker:net)\n* docker:prune:             Prune docker                                                               (aliases: docker:prune)\n* docker:push:              Push the docker image to the registry                                      (aliases: docker:push)\n* docker:stop:              Stop the project with docker compose                                       (aliases: docker:stop)\n* docker:up:                Start the project with docker compose                                      (aliases: docker:up)\n* docker:vol:               Create docker volume                                                       (aliases: docker:vol)\n* playwright:codegen:       Generate playwright code                                                   (aliases: pw:codegen)\n* playwright:install:       Install playwright drivers                                                 (aliases: pw:install)\n* poetry:add-pypi:          Add test-pypi repository                                                   (aliases: poetry:add-pypi)\n* poetry:build:             Build the poetry bin                                                       (aliases: poetry:build)\n* poetry:bump-semver:       Bump the project semantic version                                          (aliases: poetry:bump-semver)\n* poetry:export-reqs:       Export requirements.txt                                                    (aliases: poetry:export-reqs)\n* poetry:install:           Install project dependencies                                               (aliases: poetry:install)\n* poetry:publish:           Publish the poetry bin                                                     (aliases: poetry:publish)\n* poetry:update-deps:       Update dependencies                                                        (aliases: poetry:update-deps)                                           (aliases: poetry:update-deps)                                                    (aliases: poetry:update-deps)\n```\n\n## TODO\n* [Open Issues](https://github.com/pythoninthegrass/pytest_demo/issues)\n* Write boilerplate pytest tests\n\n## Further Reading\n* [Generating a Static Site with Flask | TestDriven.io](https://testdriven.io/blog/static-site-flask-and-netlify/)\n* [Create a Static Blog Using Python Flask](https://dev.to/arrantate/create-a-static-blog-using-python-flask-1oab)\n* [insomnux/flaskblog: A very simple blog with Flask and Flask-Flatpages.](https://github.com/insomnux/flaskblog)\n* [Flask-FlatPages](https://flask-flatpages.readthedocs.io/en/v0.8.2/index.html#)\n* [python](https://www.python.org/)\n* [asdf](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf)\n* [poetry](https://python-poetry.org/docs/)\n* [docker-compose](https://docs.docker.com/compose/install/)\n* [pre-commit hooks](https://pre-commit.com/)\n","funding_links":["https://github.com/sponsors/pythoninthegrass"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythoninthegrass%2Fpytest_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythoninthegrass%2Fpytest_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythoninthegrass%2Fpytest_demo/lists"}