pytest的django插件。
pytest-django的Python项目详细描述
欢迎来到Pytest Django!
pytest django允许您使用 pytest testing tool。
- Quick start / tutorial
- Changelog
- 完整文档:https://pytest-django.readthedocs.io/en/latest/
- Contribution docs
- 版本兼容性:
- 姜戈:1.8-1.11,2.0-2.2, 以及最新的主分支(在每次发布时兼容)
- python:cpython 2.7、3.4-3.7或pypy2、3
- pytest:>;=3.6
- 许可证:BSD
- 项目维护人员:Andreas Pelme、Floris Bruynooghe和Daniel Hahler
- All contributors
- github存储库:https://github.com/pytest-dev/pytest-django
- Issue tracker
- Python Package Index (PyPI)
安装pytest django
pip install pytest-django
为什么我要使用这个而不是django的manage.py test命令?
使用pytest django运行您的测试套件允许您利用这些特性 已经存在于pytest中。这里有一些优点:
- Manage test dependencies with pytest fixtures.
- 较少的样板测试:不需要导入unittest,用方法创建一个子类。将测试作为常规函数编写。
- 数据库重用:不需要为每次测试运行重新创建测试数据库。
- 在多个进程中运行测试以提高速度(使用pytest xdist插件)。
- 利用其他pytest plugins。 与两个世界一起工作:现有的无格式修改仍然没有任何修改。
有关pytest本身的更多信息,请参见pytest documentation。