File: index.rst

package info (click to toggle)
pytest-flask 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 280 kB
  • sloc: python: 553; makefile: 161; sh: 5
file content (45 lines) | stat: -rw-r--r-- 869 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Welcome to pytest-flask’s documentation!
========================================

Pytest-flask is a plugin for `pytest <https://pytest.org/en/latest/>`_ that provides
a set of useful tools to test `Flask <https://flask.palletsprojects.com/>`_ applications
and extensions.


Quickstart
----------

Install plugin via ``pip``::

    pip install pytest-flask

Define your application fixture in ``conftest.py``:

.. code:: python

    from myapp import create_app

    @pytest.fixture
    def app():
        app = create_app()
        return app

Now you can use the ``app`` fixture in your test suite. You can run your tests
with::

    pytest


User’s Guide
------------

This part of the documentation will show you how to get started in using
pytest-flask with your application.

.. toctree::
   :maxdepth: 4

   tutorial
   features
   contributing
   changelog