{"id":13502029,"url":"https://github.com/joeyespo/flask-pytest","last_synced_at":"2025-03-22T02:30:57.589Z","repository":{"id":57430622,"uuid":"41263988","full_name":"joeyespo/flask-pytest","owner":"joeyespo","description":"Runs pytest in a background process when DEBUG is True.","archived":false,"fork":false,"pushed_at":"2019-10-21T23:30:18.000Z","size":12,"stargazers_count":28,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T06:51:33.122Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joeyespo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-23T19:32:49.000Z","updated_at":"2023-09-08T17:00:53.000Z","dependencies_parsed_at":"2022-08-26T02:42:41.258Z","dependency_job_id":null,"html_url":"https://github.com/joeyespo/flask-pytest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeyespo%2Fflask-pytest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeyespo%2Fflask-pytest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeyespo%2Fflask-pytest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeyespo%2Fflask-pytest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeyespo","download_url":"https://codeload.github.com/joeyespo/flask-pytest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244897803,"owners_count":20528293,"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":[],"created_at":"2024-07-31T22:01:59.109Z","updated_at":"2025-03-22T02:30:57.246Z","avatar_url":"https://github.com/joeyespo.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Flask-pytest\n============\n\n[![Current version on PyPI](http://img.shields.io/pypi/v/flask-pytest.svg)](http://pypi.python.org/pypi/flask-pytest)\n\nRuns pytest in a background process when `DEBUG` is `True`.\n\n\nMotivation\n----------\n\nRunning tests shouldn't be something you have to go out of your way to do. With\nthis Flask extension, the tests will be automatically be run for you, and\nre-run when code changes.\n\n\nInstallation\n------------\n\n```bash\n$ pip install flask-pytest\n```\n\n\nUsage\n-----\n\nAdd `app = FlaskPytest(app)` to your project:\n\n```python\nfrom flask import Flask\nfrom flask.ext.pytest import FlaskPytest\n\napp = Flask(__name__)\napp.config.from_pyfile('settings.py')\n\napp = FlaskPytest(app)  # \u003c-- Add this line\n\n@app.route('/')\ndef hello():\n    return 'Hello World!'\n\napp.run()\n```\n\n##### settings.py\n\n```python\nDEBUG = True\n```\n\nYour tests will now be run in the background:\n\n```bash\n * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)\n * Restarting with reloader\nRunning tests...\n...\n3 passed in 1.20 seconds\n```\n\nIf a test fails, you'll hear a beep and see the output. Change a source file to\nreload the development server like normal, which will now re-run the tests.\n\n\nConfiguration\n-------------\n\nFlask-pytest runs out-of-the-box without any config. However, you may want to\ntweak the behavior here and there. Here's a list of available settings you can\nadd to your `app.config`:\n\n- `FLASK_PYTEST_ENABLED`: Set to `True` to run tests regardless of `DEBUG`, or\n  to `False` to disable the extension entirely. If `None`, the extension will\n  run when `DEBUG` is `True`. Default: `None`\n\n- `FLASK_PYTEST_BEEP`: Beep when pytest returns a non-zero exit code. Default: `True`\n\n- `FLASK_PYTEST_EXITFIRST`: Stops running tests if a test fails. Default: `True`\n\n- `FLASK_PYTEST_QUIET`: Runs pytest in quiet mode. Default: `True`\n\n\nContributing\n------------\n\n1. Check the open issues or open a new issue to start a discussion around\n   your feature idea or the bug you found\n2. Fork the repository, make your changes, and add yourself to [Authors.md](AUTHORS.md)\n3. Send a pull request\n\nIf your PR has been waiting a while, feel free to [ping me on Twitter](http://twitter.com/joeyespo).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeyespo%2Fflask-pytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeyespo%2Fflask-pytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeyespo%2Fflask-pytest/lists"}