Generate performance rapports from your django database performance tests.
Project description
Usage
Simply install pytest-django-queries
, write your pytest tests and mark any
test that should be counted or use the count_queries
fixture.
import pytest
@pytest.mark.count_queries
def test_query_performances():
Model.objects.all()
# Or...
def test_another_query_performances(count_queries):
Model.objects.all()
Integrating with GitHub
Testing locally
Simply install pytest-django-queries
through pip and run your
tests using pytest
. A report should have been generated in your
current working directory in a JSON file prefixed with .pytest-queries
.
Note: to override the save path, set the PYTEST_QUERIES_SAVE_PATH
environment variable to any given valid path.
Visualising Results
Comparing results
Development
First of all, clone the project locally. Then, install it using the below command.
./setup.py develop
After that, you need to install the development requirements. For that, run the below command.
pip install -e .[dev]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for pytest-django-queries-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8761cc7af68575a3e333ff52cb929f98727574c3275f8767e71985141d2557f5 |
|
MD5 | d33148aacd6dc37d63f8467fc3066f7f |
|
BLAKE2b-256 | 564fe976b2400cd0afd574d232e65b4fa565ab46e2452c715ab98923e81eac2f |