README.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .. image:: https://img.shields.io/pypi/v/pytest-django.svg?style=flat
  2. :alt: PyPI Version
  3. :target: https://pypi.python.org/pypi/pytest-django
  4. .. image:: https://img.shields.io/pypi/pyversions/pytest-django.svg
  5. :alt: Supported Python versions
  6. :target: https://pypi.python.org/pypi/pytest-django
  7. .. image:: https://travis-ci.org/pytest-dev/pytest-django.svg?branch=master
  8. :alt: Build Status
  9. :target: https://travis-ci.org/pytest-dev/pytest-django
  10. .. image:: https://img.shields.io/codecov/c/github/pytest-dev/pytest-django.svg?style=flat
  11. :alt: Coverage
  12. :target: https://codecov.io/gh/pytest-dev/pytest-django
  13. Welcome to pytest-django!
  14. =========================
  15. pytest-django allows you to test your Django project/applications with the
  16. `pytest testing tool <https://pytest.org/>`_.
  17. * `Quick start / tutorial
  18. <https://pytest-django.readthedocs.io/en/latest/tutorial.html>`_
  19. * `Changelog <https://pytest-django.readthedocs.io/en/latest/changelog.html>`_
  20. * Full documentation: https://pytest-django.readthedocs.io/en/latest/
  21. * `Contribution docs
  22. <https://pytest-django.readthedocs.io/en/latest/contributing.html>`_
  23. * Version compatibility:
  24. * Django: 1.8-1.11, 2.0-2.2,
  25. and latest master branch (compatible at the time of each release)
  26. * Python: CPython 2.7, 3.4-3.7 or PyPy 2, 3
  27. * pytest: >=3.6
  28. * Licence: BSD
  29. * Project maintainers: Andreas Pelme, Floris Bruynooghe and Daniel Hahler
  30. * `All contributors <https://github.com/pytest-dev/pytest-django/contributors>`_
  31. * GitHub repository: https://github.com/pytest-dev/pytest-django
  32. * `Issue tracker <http://github.com/pytest-dev/pytest-django/issues>`_
  33. * `Python Package Index (PyPI) <https://pypi.python.org/pypi/pytest-django/>`_
  34. Install pytest-django
  35. ---------------------
  36. ::
  37. pip install pytest-django
  38. Why would I use this instead of Django's `manage.py test` command?
  39. ------------------------------------------------------------------
  40. Running your test suite with pytest-django allows you to tap into the features
  41. that are already present in pytest. Here are some advantages:
  42. * `Manage test dependencies with pytest fixtures. <https://pytest.org/en/latest/fixture.html>`_
  43. * Less boilerplate tests: no need to import unittest, create a subclass with methods. Write tests as regular functions.
  44. * Database re-use: no need to re-create the test database for every test run.
  45. * Run tests in multiple processes for increased speed (with the pytest-xdist plugin).
  46. * Make use of other `pytest plugins <https://pytest.org/en/latest/plugins.html>`_.
  47. * Works with both worlds: Existing unittest-style TestCase's still work without any modifications.
  48. See the `pytest documentation <https://pytest.org/en/latest/>`_ for more information on pytest itself.